module GI.OSTree.Objects.BootconfigParser
(
BootconfigParser(..) ,
IsBootconfigParser ,
toBootconfigParser ,
noBootconfigParser ,
BootconfigParserCloneMethodInfo ,
bootconfigParserClone ,
BootconfigParserGetMethodInfo ,
bootconfigParserGet ,
bootconfigParserNew ,
BootconfigParserParseMethodInfo ,
bootconfigParserParse ,
BootconfigParserParseAtMethodInfo ,
bootconfigParserParseAt ,
BootconfigParserSetMethodInfo ,
bootconfigParserSet ,
BootconfigParserWriteMethodInfo ,
bootconfigParserWrite ,
BootconfigParserWriteAtMethodInfo ,
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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 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)
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
class GObject o => IsBootconfigParser o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError BootconfigParser a) =>
IsBootconfigParser a
#endif
instance IsBootconfigParser BootconfigParser
instance GObject.Object.IsObject BootconfigParser
toBootconfigParser :: IsBootconfigParser o => o -> IO BootconfigParser
toBootconfigParser = unsafeCastTo BootconfigParser
noBootconfigParser :: Maybe BootconfigParser
noBootconfigParser = Nothing
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveBootconfigParserMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveBootconfigParserMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveBootconfigParserMethod t BootconfigParser, O.MethodInfo info BootconfigParser p) => O.IsLabelProxy t (BootconfigParser -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveBootconfigParserMethod t BootconfigParser, O.MethodInfo info BootconfigParser p) => O.IsLabel t (BootconfigParser -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
instance O.HasAttributeList BootconfigParser
type instance O.AttributeList BootconfigParser = BootconfigParserAttributeList
type BootconfigParserAttributeList = ('[ ] :: [(Symbol, *)])
type instance O.SignalList BootconfigParser = BootconfigParserSignalList
type BootconfigParserSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
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'
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'
data BootconfigParserCloneMethodInfo
instance (signature ~ (m BootconfigParser), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserCloneMethodInfo a signature where
overloadedMethod _ = bootconfigParserClone
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'
data BootconfigParserGetMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserGetMethodInfo a signature where
overloadedMethod _ = bootconfigParserGet
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 ()
)
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
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'
)
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
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 ()
data BootconfigParserSetMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsBootconfigParser a) => O.MethodInfo BootconfigParserSetMethodInfo a signature where
overloadedMethod _ = bootconfigParserSet
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 ()
)
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
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'
)
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