{-# LANGUAGE EmptyDataDecls, ExistentialQuantification,
  FlexibleContexts, FlexibleInstances, ForeignFunctionInterface,
  MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies,
  TypeSynonymInstances #-}
module STD.CppString.Interface where
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import FFICXX.Runtime.Cast
import STD.CppString.RawType
import STD.Deletable.Interface

class (IDeletable a) => ICppString a where

upcastCppString ::
                forall a . (FPtr a, ICppString a) => a -> CppString
upcastCppString :: forall a. (FPtr a, ICppString a) => a -> CppString
upcastCppString a
h
  = let fh :: Ptr (Raw a)
fh = a -> Ptr (Raw a)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawCppString
fh2 :: Ptr RawCppString = Ptr (Raw a) -> Ptr RawCppString
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in Ptr (Raw CppString) -> CppString
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw CppString)
Ptr RawCppString
fh2

downcastCppString ::
                  forall a . (FPtr a, ICppString a) => CppString -> a
downcastCppString :: forall a. (FPtr a, ICppString a) => CppString -> a
downcastCppString CppString
h
  = let fh :: Ptr (Raw CppString)
fh = CppString -> Ptr (Raw CppString)
forall a. FPtr a => a -> Ptr (Raw a)
get_fptr CppString
h
        fh2 :: Ptr (Raw a)
fh2 = Ptr RawCppString -> Ptr (Raw a)
forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw CppString)
Ptr RawCppString
fh
      in Ptr (Raw a) -> a
forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2