{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.String
(
String(..) ,
newZeroString ,
#if defined(ENABLE_OVERLOADING)
ResolveStringMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
StringAppendMethodInfo ,
#endif
stringAppend ,
#if defined(ENABLE_OVERLOADING)
StringAppendCMethodInfo ,
#endif
stringAppendC ,
#if defined(ENABLE_OVERLOADING)
StringAppendLenMethodInfo ,
#endif
stringAppendLen ,
#if defined(ENABLE_OVERLOADING)
StringAppendUnicharMethodInfo ,
#endif
stringAppendUnichar ,
#if defined(ENABLE_OVERLOADING)
StringAppendUriEscapedMethodInfo ,
#endif
stringAppendUriEscaped ,
#if defined(ENABLE_OVERLOADING)
StringAsciiDownMethodInfo ,
#endif
stringAsciiDown ,
#if defined(ENABLE_OVERLOADING)
StringAsciiUpMethodInfo ,
#endif
stringAsciiUp ,
#if defined(ENABLE_OVERLOADING)
StringAssignMethodInfo ,
#endif
stringAssign ,
#if defined(ENABLE_OVERLOADING)
StringDownMethodInfo ,
#endif
stringDown ,
#if defined(ENABLE_OVERLOADING)
StringEqualMethodInfo ,
#endif
stringEqual ,
#if defined(ENABLE_OVERLOADING)
StringEraseMethodInfo ,
#endif
stringErase ,
#if defined(ENABLE_OVERLOADING)
StringFreeMethodInfo ,
#endif
stringFree ,
#if defined(ENABLE_OVERLOADING)
StringFreeToBytesMethodInfo ,
#endif
stringFreeToBytes ,
#if defined(ENABLE_OVERLOADING)
StringHashMethodInfo ,
#endif
stringHash ,
#if defined(ENABLE_OVERLOADING)
StringInsertMethodInfo ,
#endif
stringInsert ,
#if defined(ENABLE_OVERLOADING)
StringInsertCMethodInfo ,
#endif
stringInsertC ,
#if defined(ENABLE_OVERLOADING)
StringInsertLenMethodInfo ,
#endif
stringInsertLen ,
#if defined(ENABLE_OVERLOADING)
StringInsertUnicharMethodInfo ,
#endif
stringInsertUnichar ,
#if defined(ENABLE_OVERLOADING)
StringOverwriteMethodInfo ,
#endif
stringOverwrite ,
#if defined(ENABLE_OVERLOADING)
StringOverwriteLenMethodInfo ,
#endif
stringOverwriteLen ,
#if defined(ENABLE_OVERLOADING)
StringPrependMethodInfo ,
#endif
stringPrepend ,
#if defined(ENABLE_OVERLOADING)
StringPrependCMethodInfo ,
#endif
stringPrependC ,
#if defined(ENABLE_OVERLOADING)
StringPrependLenMethodInfo ,
#endif
stringPrependLen ,
#if defined(ENABLE_OVERLOADING)
StringPrependUnicharMethodInfo ,
#endif
stringPrependUnichar ,
#if defined(ENABLE_OVERLOADING)
StringSetSizeMethodInfo ,
#endif
stringSetSize ,
#if defined(ENABLE_OVERLOADING)
StringTruncateMethodInfo ,
#endif
stringTruncate ,
#if defined(ENABLE_OVERLOADING)
StringUpMethodInfo ,
#endif
stringUp ,
getStringAllocatedLen ,
setStringAllocatedLen ,
#if defined(ENABLE_OVERLOADING)
string_allocatedLen ,
#endif
getStringLen ,
setStringLen ,
#if defined(ENABLE_OVERLOADING)
string_len ,
#endif
clearStringStr ,
getStringStr ,
setStringStr ,
#if defined(ENABLE_OVERLOADING)
string_str ,
#endif
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.GLib.Structs.Bytes as GLib.Bytes
newtype String = String (SP.ManagedPtr String)
deriving (String -> String -> Bool
(String -> String -> Bool)
-> (String -> String -> Bool) -> Eq String
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: String -> String -> Bool
$c/= :: String -> String -> Bool
== :: String -> String -> Bool
$c== :: String -> String -> Bool
Eq)
instance SP.ManagedPtrNewtype String where
toManagedPtr :: String -> ManagedPtr String
toManagedPtr (String ManagedPtr String
p) = ManagedPtr String
p
foreign import ccall "g_gstring_get_type" c_g_gstring_get_type ::
IO GType
type instance O.ParentTypes String = '[]
instance O.HasParentTypes String
instance B.Types.TypedObject String where
glibType :: IO GType
glibType = IO GType
c_g_gstring_get_type
instance B.Types.GBoxed String
instance B.GValue.IsGValue String where
toGValue :: String -> IO GValue
toGValue String
o = do
GType
gtype <- IO GType
c_g_gstring_get_type
String -> (Ptr String -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr String
o (GType -> (GValue -> Ptr String -> IO ()) -> Ptr String -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr String -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO String
fromGValue GValue
gv = do
Ptr String
ptr <- GValue -> IO (Ptr String)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr String)
(ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr String -> String
String Ptr String
ptr
newZeroString :: MonadIO m => m String
newZeroString :: m String
newZeroString = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr String)
forall a. GBoxed a => Int -> IO (Ptr a)
callocBoxedBytes Int
24 IO (Ptr String) -> (Ptr String -> IO String) -> IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr String -> String
String
instance tag ~ 'AttrSet => Constructible String tag where
new :: (ManagedPtr String -> String) -> [AttrOp String tag] -> m String
new ManagedPtr String -> String
_ [AttrOp String tag]
attrs = do
String
o <- m String
forall (m :: * -> *). MonadIO m => m String
newZeroString
String -> [AttrOp String 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set String
o [AttrOp String tag]
[AttrOp String 'AttrSet]
attrs
String -> m String
forall (m :: * -> *) a. Monad m => a -> m a
return String
o
getStringStr :: MonadIO m => String -> m (Maybe T.Text)
getStringStr :: String -> m (Maybe Text)
getStringStr String
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr String -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr String
ptr Ptr String -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setStringStr :: MonadIO m => String -> CString -> m ()
setStringStr :: String -> CString -> m ()
setStringStr String
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO ()) -> IO ()) -> (Ptr String -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr String
ptr Ptr String -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearStringStr :: MonadIO m => String -> m ()
clearStringStr :: String -> m ()
clearStringStr String
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO ()) -> IO ()) -> (Ptr String -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr String
ptr Ptr String -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data StringStrFieldInfo
instance AttrInfo StringStrFieldInfo where
type AttrBaseTypeConstraint StringStrFieldInfo = (~) String
type AttrAllowedOps StringStrFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StringStrFieldInfo = (~) CString
type AttrTransferTypeConstraint StringStrFieldInfo = (~)CString
type AttrTransferType StringStrFieldInfo = CString
type AttrGetType StringStrFieldInfo = Maybe T.Text
type AttrLabel StringStrFieldInfo = "str"
type AttrOrigin StringStrFieldInfo = String
attrGet = getStringStr
attrSet = setStringStr
attrConstruct = undefined
attrClear = clearStringStr
attrTransfer _ v = do
return v
string_str :: AttrLabelProxy "str"
string_str = AttrLabelProxy
#endif
getStringLen :: MonadIO m => String -> m Word64
getStringLen :: String -> m Word64
getStringLen String
s = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO Word64) -> IO Word64
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO Word64) -> IO Word64)
-> (Ptr String -> IO Word64) -> IO Word64
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Word64
val <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek (Ptr String
ptr Ptr String -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Word64
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
val
setStringLen :: MonadIO m => String -> Word64 -> m ()
setStringLen :: String -> Word64 -> m ()
setStringLen String
s Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO ()) -> IO ()) -> (Ptr String -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr String
ptr Ptr String -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Word64
val :: Word64)
#if defined(ENABLE_OVERLOADING)
data StringLenFieldInfo
instance AttrInfo StringLenFieldInfo where
type AttrBaseTypeConstraint StringLenFieldInfo = (~) String
type AttrAllowedOps StringLenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StringLenFieldInfo = (~) Word64
type AttrTransferTypeConstraint StringLenFieldInfo = (~)Word64
type AttrTransferType StringLenFieldInfo = Word64
type AttrGetType StringLenFieldInfo = Word64
type AttrLabel StringLenFieldInfo = "len"
type AttrOrigin StringLenFieldInfo = String
attrGet = getStringLen
attrSet = setStringLen
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
string_len :: AttrLabelProxy "len"
string_len = AttrLabelProxy
#endif
getStringAllocatedLen :: MonadIO m => String -> m Word64
getStringAllocatedLen :: String -> m Word64
getStringAllocatedLen String
s = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO Word64) -> IO Word64
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO Word64) -> IO Word64)
-> (Ptr String -> IO Word64) -> IO Word64
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Word64
val <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek (Ptr String
ptr Ptr String -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO Word64
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
val
setStringAllocatedLen :: MonadIO m => String -> Word64 -> m ()
setStringAllocatedLen :: String -> Word64 -> m ()
setStringAllocatedLen String
s Word64
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ String -> (Ptr String -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr String
s ((Ptr String -> IO ()) -> IO ()) -> (Ptr String -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr String
ptr -> do
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr String
ptr Ptr String -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Word64
val :: Word64)
#if defined(ENABLE_OVERLOADING)
data StringAllocatedLenFieldInfo
instance AttrInfo StringAllocatedLenFieldInfo where
type AttrBaseTypeConstraint StringAllocatedLenFieldInfo = (~) String
type AttrAllowedOps StringAllocatedLenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StringAllocatedLenFieldInfo = (~) Word64
type AttrTransferTypeConstraint StringAllocatedLenFieldInfo = (~)Word64
type AttrTransferType StringAllocatedLenFieldInfo = Word64
type AttrGetType StringAllocatedLenFieldInfo = Word64
type AttrLabel StringAllocatedLenFieldInfo = "allocated_len"
type AttrOrigin StringAllocatedLenFieldInfo = String
attrGet = getStringAllocatedLen
attrSet = setStringAllocatedLen
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
string_allocatedLen :: AttrLabelProxy "allocatedLen"
string_allocatedLen = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList String
type instance O.AttributeList String = StringAttributeList
type StringAttributeList = ('[ '("str", StringStrFieldInfo), '("len", StringLenFieldInfo), '("allocatedLen", StringAllocatedLenFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_string_append" g_string_append ::
Ptr String ->
CString ->
IO (Ptr String)
stringAppend ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> m String
stringAppend :: String -> Text -> m String
stringAppend String
string Text
val = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> CString -> IO (Ptr String)
g_string_append Ptr String
string' CString
val'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAppend" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAppendMethodInfo
instance (signature ~ (T.Text -> m String), MonadIO m) => O.MethodInfo StringAppendMethodInfo String signature where
overloadedMethod = stringAppend
#endif
foreign import ccall "g_string_append_c" g_string_append_c ::
Ptr String ->
Int8 ->
IO (Ptr String)
stringAppendC ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int8
-> m String
stringAppendC :: String -> Int8 -> m String
stringAppendC String
string Int8
c = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Int8 -> IO (Ptr String)
g_string_append_c Ptr String
string' Int8
c
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAppendC" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAppendCMethodInfo
instance (signature ~ (Int8 -> m String), MonadIO m) => O.MethodInfo StringAppendCMethodInfo String signature where
overloadedMethod = stringAppendC
#endif
foreign import ccall "g_string_append_len" g_string_append_len ::
Ptr String ->
CString ->
Int64 ->
IO (Ptr String)
stringAppendLen ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> Int64
-> m String
stringAppendLen :: String -> Text -> Int64 -> m String
stringAppendLen String
string Text
val Int64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> CString -> Int64 -> IO (Ptr String)
g_string_append_len Ptr String
string' CString
val' Int64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAppendLen" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAppendLenMethodInfo
instance (signature ~ (T.Text -> Int64 -> m String), MonadIO m) => O.MethodInfo StringAppendLenMethodInfo String signature where
overloadedMethod = stringAppendLen
#endif
foreign import ccall "g_string_append_unichar" g_string_append_unichar ::
Ptr String ->
CInt ->
IO (Ptr String)
stringAppendUnichar ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Char
-> m String
stringAppendUnichar :: String -> Char -> m String
stringAppendUnichar String
string Char
wc = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
let wc' :: CInt
wc' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Char -> Int) -> Char -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) Char
wc
Ptr String
result <- Ptr String -> CInt -> IO (Ptr String)
g_string_append_unichar Ptr String
string' CInt
wc'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAppendUnichar" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAppendUnicharMethodInfo
instance (signature ~ (Char -> m String), MonadIO m) => O.MethodInfo StringAppendUnicharMethodInfo String signature where
overloadedMethod = stringAppendUnichar
#endif
foreign import ccall "g_string_append_uri_escaped" g_string_append_uri_escaped ::
Ptr String ->
CString ->
CString ->
CInt ->
IO (Ptr String)
stringAppendUriEscaped ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> T.Text
-> Bool
-> m String
stringAppendUriEscaped :: String -> Text -> Text -> Bool -> m String
stringAppendUriEscaped String
string Text
unescaped Text
reservedCharsAllowed Bool
allowUtf8 = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
unescaped' <- Text -> IO CString
textToCString Text
unescaped
CString
reservedCharsAllowed' <- Text -> IO CString
textToCString Text
reservedCharsAllowed
let allowUtf8' :: CInt
allowUtf8' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
allowUtf8
Ptr String
result <- Ptr String -> CString -> CString -> CInt -> IO (Ptr String)
g_string_append_uri_escaped Ptr String
string' CString
unescaped' CString
reservedCharsAllowed' CInt
allowUtf8'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAppendUriEscaped" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
unescaped'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
reservedCharsAllowed'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAppendUriEscapedMethodInfo
instance (signature ~ (T.Text -> T.Text -> Bool -> m String), MonadIO m) => O.MethodInfo StringAppendUriEscapedMethodInfo String signature where
overloadedMethod = stringAppendUriEscaped
#endif
foreign import ccall "g_string_ascii_down" g_string_ascii_down ::
Ptr String ->
IO (Ptr String)
stringAsciiDown ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m String
stringAsciiDown :: String -> m String
stringAsciiDown String
string = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> IO (Ptr String)
g_string_ascii_down Ptr String
string'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAsciiDown" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAsciiDownMethodInfo
instance (signature ~ (m String), MonadIO m) => O.MethodInfo StringAsciiDownMethodInfo String signature where
overloadedMethod = stringAsciiDown
#endif
foreign import ccall "g_string_ascii_up" g_string_ascii_up ::
Ptr String ->
IO (Ptr String)
stringAsciiUp ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m String
stringAsciiUp :: String -> m String
stringAsciiUp String
string = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> IO (Ptr String)
g_string_ascii_up Ptr String
string'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAsciiUp" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAsciiUpMethodInfo
instance (signature ~ (m String), MonadIO m) => O.MethodInfo StringAsciiUpMethodInfo String signature where
overloadedMethod = stringAsciiUp
#endif
foreign import ccall "g_string_assign" g_string_assign ::
Ptr String ->
CString ->
IO (Ptr String)
stringAssign ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> m String
stringAssign :: String -> Text -> m String
stringAssign String
string Text
rval = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
rval' <- Text -> IO CString
textToCString Text
rval
Ptr String
result <- Ptr String -> CString -> IO (Ptr String)
g_string_assign Ptr String
string' CString
rval'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringAssign" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
rval'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringAssignMethodInfo
instance (signature ~ (T.Text -> m String), MonadIO m) => O.MethodInfo StringAssignMethodInfo String signature where
overloadedMethod = stringAssign
#endif
foreign import ccall "g_string_down" g_string_down ::
Ptr String ->
IO (Ptr String)
{-# DEPRECATED stringDown ["(Since version 2.2)","This function uses the locale-specific"," @/tolower()/@ function, which is almost never the right thing."," Use 'GI.GLib.Structs.String.stringAsciiDown' or 'GI.GLib.Functions.utf8Strdown' instead."] #-}
stringDown ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m String
stringDown :: String -> m String
stringDown String
string = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> IO (Ptr String)
g_string_down Ptr String
string'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringDown" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringDownMethodInfo
instance (signature ~ (m String), MonadIO m) => O.MethodInfo StringDownMethodInfo String signature where
overloadedMethod = stringDown
#endif
foreign import ccall "g_string_equal" g_string_equal ::
Ptr String ->
Ptr String ->
IO CInt
stringEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> String
-> m Bool
stringEqual :: String -> String -> m Bool
stringEqual String
v String
v2 = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr String
v' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
v
Ptr String
v2' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
v2
CInt
result <- Ptr String -> Ptr String -> IO CInt
g_string_equal Ptr String
v' Ptr String
v2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
v
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
v2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data StringEqualMethodInfo
instance (signature ~ (String -> m Bool), MonadIO m) => O.MethodInfo StringEqualMethodInfo String signature where
overloadedMethod = stringEqual
#endif
foreign import ccall "g_string_erase" g_string_erase ::
Ptr String ->
Int64 ->
Int64 ->
IO (Ptr String)
stringErase ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int64
-> Int64
-> m String
stringErase :: String -> Int64 -> Int64 -> m String
stringErase String
string Int64
pos Int64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Int64 -> Int64 -> IO (Ptr String)
g_string_erase Ptr String
string' Int64
pos Int64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringErase" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringEraseMethodInfo
instance (signature ~ (Int64 -> Int64 -> m String), MonadIO m) => O.MethodInfo StringEraseMethodInfo String signature where
overloadedMethod = stringErase
#endif
foreign import ccall "g_string_free" g_string_free ::
Ptr String ->
CInt ->
IO CString
stringFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Bool
-> m (Maybe T.Text)
stringFree :: String -> Bool -> m (Maybe Text)
stringFree String
string Bool
freeSegment = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed String
string
let freeSegment' :: CInt
freeSegment' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
freeSegment
CString
result <- Ptr String -> CInt -> IO CString
g_string_free Ptr String
string' CInt
freeSegment'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data StringFreeMethodInfo
instance (signature ~ (Bool -> m (Maybe T.Text)), MonadIO m) => O.MethodInfo StringFreeMethodInfo String signature where
overloadedMethod = stringFree
#endif
foreign import ccall "g_string_free_to_bytes" g_string_free_to_bytes ::
Ptr String ->
IO (Ptr GLib.Bytes.Bytes)
stringFreeToBytes ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m GLib.Bytes.Bytes
stringFreeToBytes :: String -> m Bytes
stringFreeToBytes String
string = IO Bytes -> m Bytes
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed String
string
Ptr Bytes
result <- Ptr String -> IO (Ptr Bytes)
g_string_free_to_bytes Ptr String
string'
Text -> Ptr Bytes -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringFreeToBytes" Ptr Bytes
result
Bytes
result' <- ((ManagedPtr Bytes -> Bytes) -> Ptr Bytes -> IO Bytes
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Bytes -> Bytes
GLib.Bytes.Bytes) Ptr Bytes
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
Bytes -> IO Bytes
forall (m :: * -> *) a. Monad m => a -> m a
return Bytes
result'
#if defined(ENABLE_OVERLOADING)
data StringFreeToBytesMethodInfo
instance (signature ~ (m GLib.Bytes.Bytes), MonadIO m) => O.MethodInfo StringFreeToBytesMethodInfo String signature where
overloadedMethod = stringFreeToBytes
#endif
foreign import ccall "g_string_hash" g_string_hash ::
Ptr String ->
IO Word32
stringHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m Word32
stringHash :: String -> m Word32
stringHash String
str = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr String
str' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
str
Word32
result <- Ptr String -> IO Word32
g_string_hash Ptr String
str'
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
str
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data StringHashMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo StringHashMethodInfo String signature where
overloadedMethod = stringHash
#endif
foreign import ccall "g_string_insert" g_string_insert ::
Ptr String ->
Int64 ->
CString ->
IO (Ptr String)
stringInsert ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int64
-> T.Text
-> m String
stringInsert :: String -> Int64 -> Text -> m String
stringInsert String
string Int64
pos Text
val = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> Int64 -> CString -> IO (Ptr String)
g_string_insert Ptr String
string' Int64
pos CString
val'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringInsert" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringInsertMethodInfo
instance (signature ~ (Int64 -> T.Text -> m String), MonadIO m) => O.MethodInfo StringInsertMethodInfo String signature where
overloadedMethod = stringInsert
#endif
foreign import ccall "g_string_insert_c" g_string_insert_c ::
Ptr String ->
Int64 ->
Int8 ->
IO (Ptr String)
stringInsertC ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int64
-> Int8
-> m String
stringInsertC :: String -> Int64 -> Int8 -> m String
stringInsertC String
string Int64
pos Int8
c = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Int64 -> Int8 -> IO (Ptr String)
g_string_insert_c Ptr String
string' Int64
pos Int8
c
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringInsertC" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringInsertCMethodInfo
instance (signature ~ (Int64 -> Int8 -> m String), MonadIO m) => O.MethodInfo StringInsertCMethodInfo String signature where
overloadedMethod = stringInsertC
#endif
foreign import ccall "g_string_insert_len" g_string_insert_len ::
Ptr String ->
Int64 ->
CString ->
Int64 ->
IO (Ptr String)
stringInsertLen ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int64
-> T.Text
-> Int64
-> m String
stringInsertLen :: String -> Int64 -> Text -> Int64 -> m String
stringInsertLen String
string Int64
pos Text
val Int64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> Int64 -> CString -> Int64 -> IO (Ptr String)
g_string_insert_len Ptr String
string' Int64
pos CString
val' Int64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringInsertLen" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringInsertLenMethodInfo
instance (signature ~ (Int64 -> T.Text -> Int64 -> m String), MonadIO m) => O.MethodInfo StringInsertLenMethodInfo String signature where
overloadedMethod = stringInsertLen
#endif
foreign import ccall "g_string_insert_unichar" g_string_insert_unichar ::
Ptr String ->
Int64 ->
CInt ->
IO (Ptr String)
stringInsertUnichar ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int64
-> Char
-> m String
stringInsertUnichar :: String -> Int64 -> Char -> m String
stringInsertUnichar String
string Int64
pos Char
wc = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
let wc' :: CInt
wc' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Char -> Int) -> Char -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) Char
wc
Ptr String
result <- Ptr String -> Int64 -> CInt -> IO (Ptr String)
g_string_insert_unichar Ptr String
string' Int64
pos CInt
wc'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringInsertUnichar" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringInsertUnicharMethodInfo
instance (signature ~ (Int64 -> Char -> m String), MonadIO m) => O.MethodInfo StringInsertUnicharMethodInfo String signature where
overloadedMethod = stringInsertUnichar
#endif
foreign import ccall "g_string_overwrite" g_string_overwrite ::
Ptr String ->
Word64 ->
CString ->
IO (Ptr String)
stringOverwrite ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Word64
-> T.Text
-> m String
stringOverwrite :: String -> Word64 -> Text -> m String
stringOverwrite String
string Word64
pos Text
val = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> Word64 -> CString -> IO (Ptr String)
g_string_overwrite Ptr String
string' Word64
pos CString
val'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringOverwrite" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringOverwriteMethodInfo
instance (signature ~ (Word64 -> T.Text -> m String), MonadIO m) => O.MethodInfo StringOverwriteMethodInfo String signature where
overloadedMethod = stringOverwrite
#endif
foreign import ccall "g_string_overwrite_len" g_string_overwrite_len ::
Ptr String ->
Word64 ->
CString ->
Int64 ->
IO (Ptr String)
stringOverwriteLen ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Word64
-> T.Text
-> Int64
-> m String
stringOverwriteLen :: String -> Word64 -> Text -> Int64 -> m String
stringOverwriteLen String
string Word64
pos Text
val Int64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> Word64 -> CString -> Int64 -> IO (Ptr String)
g_string_overwrite_len Ptr String
string' Word64
pos CString
val' Int64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringOverwriteLen" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringOverwriteLenMethodInfo
instance (signature ~ (Word64 -> T.Text -> Int64 -> m String), MonadIO m) => O.MethodInfo StringOverwriteLenMethodInfo String signature where
overloadedMethod = stringOverwriteLen
#endif
foreign import ccall "g_string_prepend" g_string_prepend ::
Ptr String ->
CString ->
IO (Ptr String)
stringPrepend ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> m String
stringPrepend :: String -> Text -> m String
stringPrepend String
string Text
val = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> CString -> IO (Ptr String)
g_string_prepend Ptr String
string' CString
val'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringPrepend" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringPrependMethodInfo
instance (signature ~ (T.Text -> m String), MonadIO m) => O.MethodInfo StringPrependMethodInfo String signature where
overloadedMethod = stringPrepend
#endif
foreign import ccall "g_string_prepend_c" g_string_prepend_c ::
Ptr String ->
Int8 ->
IO (Ptr String)
stringPrependC ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Int8
-> m String
stringPrependC :: String -> Int8 -> m String
stringPrependC String
string Int8
c = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Int8 -> IO (Ptr String)
g_string_prepend_c Ptr String
string' Int8
c
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringPrependC" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringPrependCMethodInfo
instance (signature ~ (Int8 -> m String), MonadIO m) => O.MethodInfo StringPrependCMethodInfo String signature where
overloadedMethod = stringPrependC
#endif
foreign import ccall "g_string_prepend_len" g_string_prepend_len ::
Ptr String ->
CString ->
Int64 ->
IO (Ptr String)
stringPrependLen ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> T.Text
-> Int64
-> m String
stringPrependLen :: String -> Text -> Int64 -> m String
stringPrependLen String
string Text
val Int64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
CString
val' <- Text -> IO CString
textToCString Text
val
Ptr String
result <- Ptr String -> CString -> Int64 -> IO (Ptr String)
g_string_prepend_len Ptr String
string' CString
val' Int64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringPrependLen" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
val'
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringPrependLenMethodInfo
instance (signature ~ (T.Text -> Int64 -> m String), MonadIO m) => O.MethodInfo StringPrependLenMethodInfo String signature where
overloadedMethod = stringPrependLen
#endif
foreign import ccall "g_string_prepend_unichar" g_string_prepend_unichar ::
Ptr String ->
CInt ->
IO (Ptr String)
stringPrependUnichar ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Char
-> m String
stringPrependUnichar :: String -> Char -> m String
stringPrependUnichar String
string Char
wc = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
let wc' :: CInt
wc' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Char -> Int) -> Char -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
ord) Char
wc
Ptr String
result <- Ptr String -> CInt -> IO (Ptr String)
g_string_prepend_unichar Ptr String
string' CInt
wc'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringPrependUnichar" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringPrependUnicharMethodInfo
instance (signature ~ (Char -> m String), MonadIO m) => O.MethodInfo StringPrependUnicharMethodInfo String signature where
overloadedMethod = stringPrependUnichar
#endif
foreign import ccall "g_string_set_size" g_string_set_size ::
Ptr String ->
Word64 ->
IO (Ptr String)
stringSetSize ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Word64
-> m String
stringSetSize :: String -> Word64 -> m String
stringSetSize String
string Word64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Word64 -> IO (Ptr String)
g_string_set_size Ptr String
string' Word64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringSetSize" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringSetSizeMethodInfo
instance (signature ~ (Word64 -> m String), MonadIO m) => O.MethodInfo StringSetSizeMethodInfo String signature where
overloadedMethod = stringSetSize
#endif
foreign import ccall "g_string_truncate" g_string_truncate ::
Ptr String ->
Word64 ->
IO (Ptr String)
stringTruncate ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> Word64
-> m String
stringTruncate :: String -> Word64 -> m String
stringTruncate String
string Word64
len = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> Word64 -> IO (Ptr String)
g_string_truncate Ptr String
string' Word64
len
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringTruncate" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringTruncateMethodInfo
instance (signature ~ (Word64 -> m String), MonadIO m) => O.MethodInfo StringTruncateMethodInfo String signature where
overloadedMethod = stringTruncate
#endif
foreign import ccall "g_string_up" g_string_up ::
Ptr String ->
IO (Ptr String)
{-# DEPRECATED stringUp ["(Since version 2.2)","This function uses the locale-specific"," @/toupper()/@ function, which is almost never the right thing."," Use 'GI.GLib.Structs.String.stringAsciiUp' or 'GI.GLib.Functions.utf8Strup' instead."] #-}
stringUp ::
(B.CallStack.HasCallStack, MonadIO m) =>
String
-> m String
stringUp :: String -> m String
stringUp String
string = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr String
string' <- String -> IO (Ptr String)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr String
string
Ptr String
result <- Ptr String -> IO (Ptr String)
g_string_up Ptr String
string'
Text -> Ptr String -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"stringUp" Ptr String
result
String
result' <- ((ManagedPtr String -> String) -> Ptr String -> IO String
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr String -> String
String) Ptr String
result
String -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr String
string
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data StringUpMethodInfo
instance (signature ~ (m String), MonadIO m) => O.MethodInfo StringUpMethodInfo String signature where
overloadedMethod = stringUp
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveStringMethod (t :: Symbol) (o :: *) :: * where
ResolveStringMethod "append" o = StringAppendMethodInfo
ResolveStringMethod "appendC" o = StringAppendCMethodInfo
ResolveStringMethod "appendLen" o = StringAppendLenMethodInfo
ResolveStringMethod "appendUnichar" o = StringAppendUnicharMethodInfo
ResolveStringMethod "appendUriEscaped" o = StringAppendUriEscapedMethodInfo
ResolveStringMethod "asciiDown" o = StringAsciiDownMethodInfo
ResolveStringMethod "asciiUp" o = StringAsciiUpMethodInfo
ResolveStringMethod "assign" o = StringAssignMethodInfo
ResolveStringMethod "down" o = StringDownMethodInfo
ResolveStringMethod "equal" o = StringEqualMethodInfo
ResolveStringMethod "erase" o = StringEraseMethodInfo
ResolveStringMethod "free" o = StringFreeMethodInfo
ResolveStringMethod "freeToBytes" o = StringFreeToBytesMethodInfo
ResolveStringMethod "hash" o = StringHashMethodInfo
ResolveStringMethod "insert" o = StringInsertMethodInfo
ResolveStringMethod "insertC" o = StringInsertCMethodInfo
ResolveStringMethod "insertLen" o = StringInsertLenMethodInfo
ResolveStringMethod "insertUnichar" o = StringInsertUnicharMethodInfo
ResolveStringMethod "overwrite" o = StringOverwriteMethodInfo
ResolveStringMethod "overwriteLen" o = StringOverwriteLenMethodInfo
ResolveStringMethod "prepend" o = StringPrependMethodInfo
ResolveStringMethod "prependC" o = StringPrependCMethodInfo
ResolveStringMethod "prependLen" o = StringPrependLenMethodInfo
ResolveStringMethod "prependUnichar" o = StringPrependUnicharMethodInfo
ResolveStringMethod "truncate" o = StringTruncateMethodInfo
ResolveStringMethod "up" o = StringUpMethodInfo
ResolveStringMethod "setSize" o = StringSetSizeMethodInfo
ResolveStringMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStringMethod t String, O.MethodInfo info String p) => OL.IsLabel t (String -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif