{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.MatchInfo
(
MatchInfo(..) ,
noMatchInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveMatchInfoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MatchInfoExpandReferencesMethodInfo ,
#endif
matchInfoExpandReferences ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFetchMethodInfo ,
#endif
matchInfoFetch ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFetchAllMethodInfo ,
#endif
matchInfoFetchAll ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFetchNamedMethodInfo ,
#endif
matchInfoFetchNamed ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFetchNamedPosMethodInfo ,
#endif
matchInfoFetchNamedPos ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFetchPosMethodInfo ,
#endif
matchInfoFetchPos ,
#if defined(ENABLE_OVERLOADING)
MatchInfoFreeMethodInfo ,
#endif
matchInfoFree ,
#if defined(ENABLE_OVERLOADING)
MatchInfoGetMatchCountMethodInfo ,
#endif
matchInfoGetMatchCount ,
#if defined(ENABLE_OVERLOADING)
MatchInfoGetRegexMethodInfo ,
#endif
matchInfoGetRegex ,
#if defined(ENABLE_OVERLOADING)
MatchInfoGetStringMethodInfo ,
#endif
matchInfoGetString ,
#if defined(ENABLE_OVERLOADING)
MatchInfoIsPartialMatchMethodInfo ,
#endif
matchInfoIsPartialMatch ,
#if defined(ENABLE_OVERLOADING)
MatchInfoMatchesMethodInfo ,
#endif
matchInfoMatches ,
#if defined(ENABLE_OVERLOADING)
MatchInfoNextMethodInfo ,
#endif
matchInfoNext ,
#if defined(ENABLE_OVERLOADING)
MatchInfoRefMethodInfo ,
#endif
matchInfoRef ,
#if defined(ENABLE_OVERLOADING)
MatchInfoUnrefMethodInfo ,
#endif
matchInfoUnref ,
) 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.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 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.Regex as GLib.Regex
newtype MatchInfo = MatchInfo (ManagedPtr MatchInfo)
deriving (MatchInfo -> MatchInfo -> Bool
(MatchInfo -> MatchInfo -> Bool)
-> (MatchInfo -> MatchInfo -> Bool) -> Eq MatchInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchInfo -> MatchInfo -> Bool
$c/= :: MatchInfo -> MatchInfo -> Bool
== :: MatchInfo -> MatchInfo -> Bool
$c== :: MatchInfo -> MatchInfo -> Bool
Eq)
foreign import ccall "g_match_info_get_type" c_g_match_info_get_type ::
IO GType
instance BoxedObject MatchInfo where
boxedType :: MatchInfo -> IO GType
boxedType _ = IO GType
c_g_match_info_get_type
instance B.GValue.IsGValue MatchInfo where
toGValue :: MatchInfo -> IO GValue
toGValue o :: MatchInfo
o = do
GType
gtype <- IO GType
c_g_match_info_get_type
MatchInfo -> (Ptr MatchInfo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr MatchInfo
o (GType
-> (GValue -> Ptr MatchInfo -> IO ()) -> Ptr MatchInfo -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr MatchInfo -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO MatchInfo
fromGValue gv :: GValue
gv = do
Ptr MatchInfo
ptr <- GValue -> IO (Ptr MatchInfo)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr MatchInfo)
(ManagedPtr MatchInfo -> MatchInfo)
-> Ptr MatchInfo -> IO MatchInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr MatchInfo -> MatchInfo
MatchInfo Ptr MatchInfo
ptr
noMatchInfo :: Maybe MatchInfo
noMatchInfo :: Maybe MatchInfo
noMatchInfo = Maybe MatchInfo
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList MatchInfo
type instance O.AttributeList MatchInfo = MatchInfoAttributeList
type MatchInfoAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_match_info_expand_references" g_match_info_expand_references ::
Ptr MatchInfo ->
CString ->
Ptr (Ptr GError) ->
IO CString
matchInfoExpandReferences ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> T.Text
-> m (Maybe T.Text)
matchInfoExpandReferences :: MatchInfo -> Text -> m (Maybe Text)
matchInfoExpandReferences matchInfo :: MatchInfo
matchInfo stringToExpand :: Text
stringToExpand = 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 MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CString
stringToExpand' <- Text -> IO CString
textToCString Text
stringToExpand
IO (Maybe Text) -> IO () -> IO (Maybe Text)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr MatchInfo -> CString -> Ptr (Ptr GError) -> IO CString
g_match_info_expand_references Ptr MatchInfo
matchInfo' CString
stringToExpand'
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
$ \result' :: 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''
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
stringToExpand'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
stringToExpand'
)
#if defined(ENABLE_OVERLOADING)
data MatchInfoExpandReferencesMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m) => O.MethodInfo MatchInfoExpandReferencesMethodInfo MatchInfo signature where
overloadedMethod = matchInfoExpandReferences
#endif
foreign import ccall "g_match_info_fetch" g_match_info_fetch ::
Ptr MatchInfo ->
Int32 ->
IO CString
matchInfoFetch ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> Int32
-> m (Maybe T.Text)
matchInfoFetch :: MatchInfo -> Int32 -> m (Maybe Text)
matchInfoFetch matchInfo :: MatchInfo
matchInfo matchNum :: Int32
matchNum = 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 MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CString
result <- Ptr MatchInfo -> Int32 -> IO CString
g_match_info_fetch Ptr MatchInfo
matchInfo' Int32
matchNum
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
$ \result' :: 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''
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data MatchInfoFetchMethodInfo
instance (signature ~ (Int32 -> m (Maybe T.Text)), MonadIO m) => O.MethodInfo MatchInfoFetchMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFetch
#endif
foreign import ccall "g_match_info_fetch_all" g_match_info_fetch_all ::
Ptr MatchInfo ->
IO (Ptr CString)
matchInfoFetchAll ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m [T.Text]
matchInfoFetchAll :: MatchInfo -> m [Text]
matchInfoFetchAll matchInfo :: MatchInfo
matchInfo = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr CString
result <- Ptr MatchInfo -> IO (Ptr CString)
g_match_info_fetch_all Ptr MatchInfo
matchInfo'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "matchInfoFetchAll" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoFetchAllMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m) => O.MethodInfo MatchInfoFetchAllMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFetchAll
#endif
foreign import ccall "g_match_info_fetch_named" g_match_info_fetch_named ::
Ptr MatchInfo ->
CString ->
IO CString
matchInfoFetchNamed ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> T.Text
-> m (Maybe T.Text)
matchInfoFetchNamed :: MatchInfo -> Text -> m (Maybe Text)
matchInfoFetchNamed matchInfo :: MatchInfo
matchInfo name :: Text
name = 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 MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CString
name' <- Text -> IO CString
textToCString Text
name
CString
result <- Ptr MatchInfo -> CString -> IO CString
g_match_info_fetch_named Ptr MatchInfo
matchInfo' CString
name'
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
$ \result' :: 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''
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data MatchInfoFetchNamedMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m) => O.MethodInfo MatchInfoFetchNamedMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFetchNamed
#endif
foreign import ccall "g_match_info_fetch_named_pos" g_match_info_fetch_named_pos ::
Ptr MatchInfo ->
CString ->
Ptr Int32 ->
Ptr Int32 ->
IO CInt
matchInfoFetchNamedPos ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> T.Text
-> m ((Bool, Int32, Int32))
matchInfoFetchNamedPos :: MatchInfo -> Text -> m (Bool, Int32, Int32)
matchInfoFetchNamedPos matchInfo :: MatchInfo
matchInfo name :: Text
name = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr Int32
startPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr MatchInfo -> CString -> Ptr Int32 -> Ptr Int32 -> IO CInt
g_match_info_fetch_named_pos Ptr MatchInfo
matchInfo' CString
name' Ptr Int32
startPos Ptr Int32
endPos
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Int32
startPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startPos
Int32
endPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endPos
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
startPos
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
endPos
(Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
startPos', Int32
endPos')
#if defined(ENABLE_OVERLOADING)
data MatchInfoFetchNamedPosMethodInfo
instance (signature ~ (T.Text -> m ((Bool, Int32, Int32))), MonadIO m) => O.MethodInfo MatchInfoFetchNamedPosMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFetchNamedPos
#endif
foreign import ccall "g_match_info_fetch_pos" g_match_info_fetch_pos ::
Ptr MatchInfo ->
Int32 ->
Ptr Int32 ->
Ptr Int32 ->
IO CInt
matchInfoFetchPos ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> Int32
-> m ((Bool, Int32, Int32))
matchInfoFetchPos :: MatchInfo -> Int32 -> m (Bool, Int32, Int32)
matchInfoFetchPos matchInfo :: MatchInfo
matchInfo matchNum :: Int32
matchNum = IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32))
-> IO (Bool, Int32, Int32) -> m (Bool, Int32, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr Int32
startPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
Ptr Int32
endPos <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr MatchInfo -> Int32 -> Ptr Int32 -> Ptr Int32 -> IO CInt
g_match_info_fetch_pos Ptr MatchInfo
matchInfo' Int32
matchNum Ptr Int32
startPos Ptr Int32
endPos
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
Int32
startPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
startPos
Int32
endPos' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
endPos
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
startPos
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
endPos
(Bool, Int32, Int32) -> IO (Bool, Int32, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
startPos', Int32
endPos')
#if defined(ENABLE_OVERLOADING)
data MatchInfoFetchPosMethodInfo
instance (signature ~ (Int32 -> m ((Bool, Int32, Int32))), MonadIO m) => O.MethodInfo MatchInfoFetchPosMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFetchPos
#endif
foreign import ccall "g_match_info_free" g_match_info_free ::
Ptr MatchInfo ->
IO ()
matchInfoFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m ()
matchInfoFree :: MatchInfo -> m ()
matchInfoFree matchInfo :: MatchInfo
matchInfo = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr MatchInfo -> IO ()
g_match_info_free Ptr MatchInfo
matchInfo'
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatchInfoFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo MatchInfoFreeMethodInfo MatchInfo signature where
overloadedMethod = matchInfoFree
#endif
foreign import ccall "g_match_info_get_match_count" g_match_info_get_match_count ::
Ptr MatchInfo ->
IO Int32
matchInfoGetMatchCount ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m Int32
matchInfoGetMatchCount :: MatchInfo -> m Int32
matchInfoGetMatchCount matchInfo :: MatchInfo
matchInfo = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Int32
result <- Ptr MatchInfo -> IO Int32
g_match_info_get_match_count Ptr MatchInfo
matchInfo'
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
#if defined(ENABLE_OVERLOADING)
data MatchInfoGetMatchCountMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo MatchInfoGetMatchCountMethodInfo MatchInfo signature where
overloadedMethod = matchInfoGetMatchCount
#endif
foreign import ccall "g_match_info_get_regex" g_match_info_get_regex ::
Ptr MatchInfo ->
IO (Ptr GLib.Regex.Regex)
matchInfoGetRegex ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m GLib.Regex.Regex
matchInfoGetRegex :: MatchInfo -> m Regex
matchInfoGetRegex matchInfo :: MatchInfo
matchInfo = IO Regex -> m Regex
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Regex -> m Regex) -> IO Regex -> m Regex
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr Regex
result <- Ptr MatchInfo -> IO (Ptr Regex)
g_match_info_get_regex Ptr MatchInfo
matchInfo'
Text -> Ptr Regex -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "matchInfoGetRegex" Ptr Regex
result
Regex
result' <- ((ManagedPtr Regex -> Regex) -> Ptr Regex -> IO Regex
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Regex -> Regex
GLib.Regex.Regex) Ptr Regex
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Regex -> IO Regex
forall (m :: * -> *) a. Monad m => a -> m a
return Regex
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoGetRegexMethodInfo
instance (signature ~ (m GLib.Regex.Regex), MonadIO m) => O.MethodInfo MatchInfoGetRegexMethodInfo MatchInfo signature where
overloadedMethod = matchInfoGetRegex
#endif
foreign import ccall "g_match_info_get_string" g_match_info_get_string ::
Ptr MatchInfo ->
IO CString
matchInfoGetString ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m T.Text
matchInfoGetString :: MatchInfo -> m Text
matchInfoGetString matchInfo :: MatchInfo
matchInfo = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CString
result <- Ptr MatchInfo -> IO CString
g_match_info_get_string Ptr MatchInfo
matchInfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "matchInfoGetString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoGetStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo MatchInfoGetStringMethodInfo MatchInfo signature where
overloadedMethod = matchInfoGetString
#endif
foreign import ccall "g_match_info_is_partial_match" g_match_info_is_partial_match ::
Ptr MatchInfo ->
IO CInt
matchInfoIsPartialMatch ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m Bool
matchInfoIsPartialMatch :: MatchInfo -> m Bool
matchInfoIsPartialMatch matchInfo :: MatchInfo
matchInfo = 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 MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CInt
result <- Ptr MatchInfo -> IO CInt
g_match_info_is_partial_match Ptr MatchInfo
matchInfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoIsPartialMatchMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo MatchInfoIsPartialMatchMethodInfo MatchInfo signature where
overloadedMethod = matchInfoIsPartialMatch
#endif
foreign import ccall "g_match_info_matches" g_match_info_matches ::
Ptr MatchInfo ->
IO CInt
matchInfoMatches ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m Bool
matchInfoMatches :: MatchInfo -> m Bool
matchInfoMatches matchInfo :: MatchInfo
matchInfo = 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 MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
CInt
result <- Ptr MatchInfo -> IO CInt
g_match_info_matches Ptr MatchInfo
matchInfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoMatchesMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo MatchInfoMatchesMethodInfo MatchInfo signature where
overloadedMethod = matchInfoMatches
#endif
foreign import ccall "g_match_info_next" g_match_info_next ::
Ptr MatchInfo ->
Ptr (Ptr GError) ->
IO CInt
matchInfoNext ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m ()
matchInfoNext :: MatchInfo -> m ()
matchInfoNext matchInfo :: MatchInfo
matchInfo = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr MatchInfo -> Ptr (Ptr GError) -> IO CInt
g_match_info_next Ptr MatchInfo
matchInfo'
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MatchInfoNextMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo MatchInfoNextMethodInfo MatchInfo signature where
overloadedMethod = matchInfoNext
#endif
foreign import ccall "g_match_info_ref" g_match_info_ref ::
Ptr MatchInfo ->
IO (Ptr MatchInfo)
matchInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m MatchInfo
matchInfoRef :: MatchInfo -> m MatchInfo
matchInfoRef matchInfo :: MatchInfo
matchInfo = IO MatchInfo -> m MatchInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MatchInfo -> m MatchInfo) -> IO MatchInfo -> m MatchInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr MatchInfo
result <- Ptr MatchInfo -> IO (Ptr MatchInfo)
g_match_info_ref Ptr MatchInfo
matchInfo'
Text -> Ptr MatchInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "matchInfoRef" Ptr MatchInfo
result
MatchInfo
result' <- ((ManagedPtr MatchInfo -> MatchInfo)
-> Ptr MatchInfo -> IO MatchInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr MatchInfo -> MatchInfo
MatchInfo) Ptr MatchInfo
result
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
MatchInfo -> IO MatchInfo
forall (m :: * -> *) a. Monad m => a -> m a
return MatchInfo
result'
#if defined(ENABLE_OVERLOADING)
data MatchInfoRefMethodInfo
instance (signature ~ (m MatchInfo), MonadIO m) => O.MethodInfo MatchInfoRefMethodInfo MatchInfo signature where
overloadedMethod = matchInfoRef
#endif
foreign import ccall "g_match_info_unref" g_match_info_unref ::
Ptr MatchInfo ->
IO ()
matchInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
MatchInfo
-> m ()
matchInfoUnref :: MatchInfo -> m ()
matchInfoUnref matchInfo :: MatchInfo
matchInfo = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr MatchInfo
matchInfo' <- MatchInfo -> IO (Ptr MatchInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MatchInfo
matchInfo
Ptr MatchInfo -> IO ()
g_match_info_unref Ptr MatchInfo
matchInfo'
MatchInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MatchInfo
matchInfo
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MatchInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo MatchInfoUnrefMethodInfo MatchInfo signature where
overloadedMethod = matchInfoUnref
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMatchInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveMatchInfoMethod "expandReferences" o = MatchInfoExpandReferencesMethodInfo
ResolveMatchInfoMethod "fetch" o = MatchInfoFetchMethodInfo
ResolveMatchInfoMethod "fetchAll" o = MatchInfoFetchAllMethodInfo
ResolveMatchInfoMethod "fetchNamed" o = MatchInfoFetchNamedMethodInfo
ResolveMatchInfoMethod "fetchNamedPos" o = MatchInfoFetchNamedPosMethodInfo
ResolveMatchInfoMethod "fetchPos" o = MatchInfoFetchPosMethodInfo
ResolveMatchInfoMethod "free" o = MatchInfoFreeMethodInfo
ResolveMatchInfoMethod "isPartialMatch" o = MatchInfoIsPartialMatchMethodInfo
ResolveMatchInfoMethod "matches" o = MatchInfoMatchesMethodInfo
ResolveMatchInfoMethod "next" o = MatchInfoNextMethodInfo
ResolveMatchInfoMethod "ref" o = MatchInfoRefMethodInfo
ResolveMatchInfoMethod "unref" o = MatchInfoUnrefMethodInfo
ResolveMatchInfoMethod "getMatchCount" o = MatchInfoGetMatchCountMethodInfo
ResolveMatchInfoMethod "getRegex" o = MatchInfoGetRegexMethodInfo
ResolveMatchInfoMethod "getString" o = MatchInfoGetStringMethodInfo
ResolveMatchInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMatchInfoMethod t MatchInfo, O.MethodInfo info MatchInfo p) => OL.IsLabel t (MatchInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif