{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.BootconfigParser
(
BootconfigParser(..) ,
IsBootconfigParser ,
toBootconfigParser ,
noBootconfigParser ,
#if defined(ENABLE_OVERLOADING)
ResolveBootconfigParserMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
BootconfigParserCloneMethodInfo ,
#endif
bootconfigParserClone ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserGetMethodInfo ,
#endif
bootconfigParserGet ,
bootconfigParserNew ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserParseMethodInfo ,
#endif
bootconfigParserParse ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserParseAtMethodInfo ,
#endif
bootconfigParserParseAt ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserSetMethodInfo ,
#endif
bootconfigParserSet ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserWriteMethodInfo ,
#endif
bootconfigParserWrite ,
#if defined(ENABLE_OVERLOADING)
BootconfigParserWriteAtMethodInfo ,
#endif
bootconfigParserWriteAt ,
) 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 qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
newtype BootconfigParser = BootconfigParser (ManagedPtr BootconfigParser)
deriving (Eq)
foreign import ccall "ostree_bootconfig_parser_get_type"
c_ostree_bootconfig_parser_get_type :: IO GType
instance GObject BootconfigParser where
gobjectType = c_ostree_bootconfig_parser_get_type
instance B.GValue.IsGValue BootconfigParser where
toGValue o = do
gtype <- c_ostree_bootconfig_parser_get_type
B.ManagedPtr.withManagedPtr o (B.GValue.buildGValue gtype B.GValue.set_object)
fromGValue gv = do
ptr <- B.GValue.get_object gv :: IO (Ptr BootconfigParser)
B.ManagedPtr.newObject BootconfigParser ptr
class (GObject o, O.IsDescendantOf BootconfigParser o) => IsBootconfigParser o
instance (GObject o, O.IsDescendantOf BootconfigParser o) => IsBootconfigParser o
instance O.HasParentTypes BootconfigParser
type instance O.ParentTypes BootconfigParser = '[GObject.Object.Object]
toBootconfigParser :: (MonadIO m, IsBootconfigParser o) => o -> m BootconfigParser
toBootconfigParser = liftIO . unsafeCastTo BootconfigParser
noBootconfigParser :: Maybe BootconfigParser
noBootconfigParser = Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveBootconfigParserMethod (t :: Symbol) (o :: *) :: * where
ResolveBootconfigParserMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveBootconfigParserMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveBootconfigParserMethod "clone" o = BootconfigParserCloneMethodInfo
ResolveBootconfigParserMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveBootconfigParserMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveBootconfigParserMethod "get" o = BootconfigParserGetMethodInfo
ResolveBootconfigParserMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveBootconfigParserMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveBootconfigParserMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveBootconfigParserMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveBootconfigParserMethod "parse" o = BootconfigParserParseMethodInfo
ResolveBootconfigParserMethod "parseAt" o = BootconfigParserParseAtMethodInfo
ResolveBootconfigParserMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveBootconfigParserMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveBootconfigParserMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveBootconfigParserMethod "set" o = BootconfigParserSetMethodInfo
ResolveBootconfigParserMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveBootconfigParserMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveBootconfigParserMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveBootconfigParserMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveBootconfigParserMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveBootconfigParserMethod "write" o = BootconfigParserWriteMethodInfo
ResolveBootconfigParserMethod "writeAt" o = BootconfigParserWriteAtMethodInfo
ResolveBootconfigParserMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveBootconfigParserMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveBootconfigParserMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveBootconfigParserMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveBootconfigParserMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveBootconfigParserMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBootconfigParserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBootconfigParserMethod t BootconfigParser, O.MethodInfo info BootconfigParser p) => OL.IsLabel t (BootconfigParser -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList BootconfigParser
type instance O.AttributeList BootconfigParser = BootconfigParserAttributeList
type BootconfigParserAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList BootconfigParser = BootconfigParserSignalList
type BootconfigParserSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ostree_bootconfig_parser_new" ostree_bootconfig_parser_new ::
IO (Ptr BootconfigParser)
bootconfigParserNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m BootconfigParser
bootconfigParserNew = liftIO $ do
result <- ostree_bootconfig_parser_new
checkUnexpectedReturnNULL "bootconfigParserNew" result
result' <- (wrapObject BootconfigParser) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_bootconfig_parser_clone" ostree_bootconfig_parser_clone ::
Ptr BootconfigParser ->
IO (Ptr BootconfigParser)
bootconfigParserClone ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> m BootconfigParser
bootconfigParserClone self = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result <- ostree_bootconfig_parser_clone self'
checkUnexpectedReturnNULL "bootconfigParserClone" result
result' <- (wrapObject BootconfigParser) result
touchManagedPtr self
return result'
#if defined(ENABLE_OVERLOADING)
data BootconfigParserCloneMethodInfo
instance (signature ~ (m BootconfigParser), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserCloneMethodInfo a signature where
overloadedMethod = bootconfigParserClone
#endif
foreign import ccall "ostree_bootconfig_parser_get" ostree_bootconfig_parser_get ::
Ptr BootconfigParser ->
CString ->
IO CString
bootconfigParserGet ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> T.Text
-> m T.Text
bootconfigParserGet self key = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
key' <- textToCString key
result <- ostree_bootconfig_parser_get self' key'
checkUnexpectedReturnNULL "bootconfigParserGet" result
result' <- cstringToText result
touchManagedPtr self
freeMem key'
return result'
#if defined(ENABLE_OVERLOADING)
data BootconfigParserGetMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserGetMethodInfo a signature where
overloadedMethod = bootconfigParserGet
#endif
foreign import ccall "ostree_bootconfig_parser_parse" ostree_bootconfig_parser_parse ::
Ptr BootconfigParser ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserParse ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m ()
bootconfigParserParse self path cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
path' <- unsafeManagedPtrCastPtr path
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ ostree_bootconfig_parser_parse self' path' maybeCancellable
touchManagedPtr self
touchManagedPtr path
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo BootconfigParserParseMethodInfo a signature where
overloadedMethod = bootconfigParserParse
#endif
foreign import ccall "ostree_bootconfig_parser_parse_at" ostree_bootconfig_parser_parse_at ::
Ptr BootconfigParser ->
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserParseAt ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> T.Text
-> Maybe (b)
-> m ()
bootconfigParserParseAt self dfd path cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
path' <- textToCString path
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ ostree_bootconfig_parser_parse_at self' dfd path' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
freeMem path'
return ()
) (do
freeMem path'
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserParseAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BootconfigParserParseAtMethodInfo a signature where
overloadedMethod = bootconfigParserParseAt
#endif
foreign import ccall "ostree_bootconfig_parser_set" ostree_bootconfig_parser_set ::
Ptr BootconfigParser ->
CString ->
CString ->
IO ()
bootconfigParserSet ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a) =>
a
-> T.Text
-> T.Text
-> m ()
bootconfigParserSet self key value = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
key' <- textToCString key
value' <- textToCString value
ostree_bootconfig_parser_set self' key' value'
touchManagedPtr self
freeMem key'
freeMem value'
return ()
#if defined(ENABLE_OVERLOADING)
data BootconfigParserSetMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserSetMethodInfo a signature where
overloadedMethod = bootconfigParserSet
#endif
foreign import ccall "ostree_bootconfig_parser_write" ostree_bootconfig_parser_write ::
Ptr BootconfigParser ->
Ptr Gio.File.File ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserWrite ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) =>
a
-> b
-> Maybe (c)
-> m ()
bootconfigParserWrite self output cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
output' <- unsafeManagedPtrCastPtr output
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ ostree_bootconfig_parser_write self' output' maybeCancellable
touchManagedPtr self
touchManagedPtr output
whenJust cancellable touchManagedPtr
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteMethodInfo
instance (signature ~ (b -> Maybe (c) -> m ()), MonadIO m, IsBootconfigParser a, Gio.File.IsFile b, Gio.Cancellable.IsCancellable c) => O.MethodInfo BootconfigParserWriteMethodInfo a signature where
overloadedMethod = bootconfigParserWrite
#endif
foreign import ccall "ostree_bootconfig_parser_write_at" ostree_bootconfig_parser_write_at ::
Ptr BootconfigParser ->
Int32 ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO CInt
bootconfigParserWriteAt ::
(B.CallStack.HasCallStack, MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> T.Text
-> Maybe (b)
-> m ()
bootconfigParserWriteAt self dfd path cancellable = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
path' <- textToCString path
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
onException (do
_ <- propagateGError $ ostree_bootconfig_parser_write_at self' dfd path' maybeCancellable
touchManagedPtr self
whenJust cancellable touchManagedPtr
freeMem path'
return ()
) (do
freeMem path'
)
#if defined(ENABLE_OVERLOADING)
data BootconfigParserWriteAtMethodInfo
instance (signature ~ (Int32 -> T.Text -> Maybe (b) -> m ()), MonadIO m, IsBootconfigParser a, Gio.Cancellable.IsCancellable b) => O.MethodInfo BootconfigParserWriteAtMethodInfo a signature where
overloadedMethod = bootconfigParserWriteAt
#endif