{-# 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 = forall a. FPtr a => a -> Ptr (Raw a)
get_fptr a
h
        Ptr RawCppString
fh2 :: Ptr RawCppString = forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw a)
fh
      in forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj 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 = forall a. FPtr a => a -> Ptr (Raw a)
get_fptr CppString
h
        fh2 :: Ptr (Raw a)
fh2 = forall a b. Ptr a -> Ptr b
castPtr Ptr (Raw CppString)
fh
      in forall a. FPtr a => Ptr (Raw a) -> a
cast_fptr_to_obj Ptr (Raw a)
fh2