{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Json.Structs.Node
(
Node(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveNodeMethod ,
#endif
nodeAlloc ,
#if defined(ENABLE_OVERLOADING)
NodeCopyMethodInfo ,
#endif
nodeCopy ,
#if defined(ENABLE_OVERLOADING)
NodeDupArrayMethodInfo ,
#endif
nodeDupArray ,
#if defined(ENABLE_OVERLOADING)
NodeDupObjectMethodInfo ,
#endif
nodeDupObject ,
#if defined(ENABLE_OVERLOADING)
NodeDupStringMethodInfo ,
#endif
nodeDupString ,
#if defined(ENABLE_OVERLOADING)
NodeEqualMethodInfo ,
#endif
nodeEqual ,
#if defined(ENABLE_OVERLOADING)
NodeFreeMethodInfo ,
#endif
nodeFree ,
#if defined(ENABLE_OVERLOADING)
NodeGetArrayMethodInfo ,
#endif
nodeGetArray ,
#if defined(ENABLE_OVERLOADING)
NodeGetBooleanMethodInfo ,
#endif
nodeGetBoolean ,
#if defined(ENABLE_OVERLOADING)
NodeGetDoubleMethodInfo ,
#endif
nodeGetDouble ,
#if defined(ENABLE_OVERLOADING)
NodeGetIntMethodInfo ,
#endif
nodeGetInt ,
#if defined(ENABLE_OVERLOADING)
NodeGetNodeTypeMethodInfo ,
#endif
nodeGetNodeType ,
#if defined(ENABLE_OVERLOADING)
NodeGetObjectMethodInfo ,
#endif
nodeGetObject ,
#if defined(ENABLE_OVERLOADING)
NodeGetParentMethodInfo ,
#endif
nodeGetParent ,
#if defined(ENABLE_OVERLOADING)
NodeGetStringMethodInfo ,
#endif
nodeGetString ,
#if defined(ENABLE_OVERLOADING)
NodeGetValueMethodInfo ,
#endif
nodeGetValue ,
#if defined(ENABLE_OVERLOADING)
NodeGetValueTypeMethodInfo ,
#endif
nodeGetValueType ,
#if defined(ENABLE_OVERLOADING)
NodeHashMethodInfo ,
#endif
nodeHash ,
#if defined(ENABLE_OVERLOADING)
NodeInitMethodInfo ,
#endif
nodeInit ,
#if defined(ENABLE_OVERLOADING)
NodeInitArrayMethodInfo ,
#endif
nodeInitArray ,
#if defined(ENABLE_OVERLOADING)
NodeInitBooleanMethodInfo ,
#endif
nodeInitBoolean ,
#if defined(ENABLE_OVERLOADING)
NodeInitDoubleMethodInfo ,
#endif
nodeInitDouble ,
#if defined(ENABLE_OVERLOADING)
NodeInitIntMethodInfo ,
#endif
nodeInitInt ,
#if defined(ENABLE_OVERLOADING)
NodeInitNullMethodInfo ,
#endif
nodeInitNull ,
#if defined(ENABLE_OVERLOADING)
NodeInitObjectMethodInfo ,
#endif
nodeInitObject ,
#if defined(ENABLE_OVERLOADING)
NodeInitStringMethodInfo ,
#endif
nodeInitString ,
#if defined(ENABLE_OVERLOADING)
NodeIsImmutableMethodInfo ,
#endif
nodeIsImmutable ,
#if defined(ENABLE_OVERLOADING)
NodeIsNullMethodInfo ,
#endif
nodeIsNull ,
nodeNew ,
#if defined(ENABLE_OVERLOADING)
NodeRefMethodInfo ,
#endif
nodeRef ,
#if defined(ENABLE_OVERLOADING)
NodeSealMethodInfo ,
#endif
nodeSeal ,
#if defined(ENABLE_OVERLOADING)
NodeSetArrayMethodInfo ,
#endif
nodeSetArray ,
#if defined(ENABLE_OVERLOADING)
NodeSetBooleanMethodInfo ,
#endif
nodeSetBoolean ,
#if defined(ENABLE_OVERLOADING)
NodeSetDoubleMethodInfo ,
#endif
nodeSetDouble ,
#if defined(ENABLE_OVERLOADING)
NodeSetIntMethodInfo ,
#endif
nodeSetInt ,
#if defined(ENABLE_OVERLOADING)
NodeSetObjectMethodInfo ,
#endif
nodeSetObject ,
#if defined(ENABLE_OVERLOADING)
NodeSetParentMethodInfo ,
#endif
nodeSetParent ,
#if defined(ENABLE_OVERLOADING)
NodeSetStringMethodInfo ,
#endif
nodeSetString ,
#if defined(ENABLE_OVERLOADING)
NodeSetValueMethodInfo ,
#endif
nodeSetValue ,
#if defined(ENABLE_OVERLOADING)
NodeTakeArrayMethodInfo ,
#endif
nodeTakeArray ,
#if defined(ENABLE_OVERLOADING)
NodeTakeObjectMethodInfo ,
#endif
nodeTakeObject ,
#if defined(ENABLE_OVERLOADING)
NodeTypeNameMethodInfo ,
#endif
nodeTypeName ,
#if defined(ENABLE_OVERLOADING)
NodeUnrefMethodInfo ,
#endif
nodeUnref ,
) 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.GArray as B.GArray
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.Coerce as Coerce
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 GHC.Records as R
import {-# SOURCE #-} qualified GI.Json.Enums as Json.Enums
import {-# SOURCE #-} qualified GI.Json.Structs.Array as Json.Array
import {-# SOURCE #-} qualified GI.Json.Structs.Object as Json.Object
newtype Node = Node (SP.ManagedPtr Node)
deriving (Node -> Node -> Bool
(Node -> Node -> Bool) -> (Node -> Node -> Bool) -> Eq Node
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Node -> Node -> Bool
$c/= :: Node -> Node -> Bool
== :: Node -> Node -> Bool
$c== :: Node -> Node -> Bool
Eq)
instance SP.ManagedPtrNewtype Node where
toManagedPtr :: Node -> ManagedPtr Node
toManagedPtr (Node ManagedPtr Node
p) = ManagedPtr Node
p
foreign import ccall "json_node_get_type" c_json_node_get_type ::
IO GType
type instance O.ParentTypes Node = '[]
instance O.HasParentTypes Node
instance B.Types.TypedObject Node where
glibType :: IO GType
glibType = IO GType
c_json_node_get_type
instance B.Types.GBoxed Node
instance B.GValue.IsGValue (Maybe Node) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_json_node_get_type
gvalueSet_ :: Ptr GValue -> Maybe Node -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Node
P.Nothing = Ptr GValue -> Ptr Node -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr Node
forall a. Ptr a
FP.nullPtr :: FP.Ptr Node)
gvalueSet_ Ptr GValue
gv (P.Just Node
obj) = Node -> (Ptr Node -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Node
obj (Ptr GValue -> Ptr Node -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Node)
gvalueGet_ Ptr GValue
gv = do
Ptr Node
ptr <- Ptr GValue -> IO (Ptr Node)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr Node)
if Ptr Node
ptr Ptr Node -> Ptr Node -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Node
forall a. Ptr a
FP.nullPtr
then Node -> Maybe Node
forall a. a -> Maybe a
P.Just (Node -> Maybe Node) -> IO Node -> IO (Maybe Node)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr Node -> Node
Node Ptr Node
ptr
else Maybe Node -> IO (Maybe Node)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Node
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Node
type instance O.AttributeList Node = NodeAttributeList
type NodeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "json_node_alloc" json_node_alloc ::
IO (Ptr Node)
nodeAlloc ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Node
nodeAlloc :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Node
nodeAlloc = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
result <- IO (Ptr Node)
json_node_alloc
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeAlloc" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "json_node_new" json_node_new ::
CUInt ->
IO (Ptr Node)
nodeNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Json.Enums.NodeType
-> m Node
nodeNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
NodeType -> m Node
nodeNew NodeType
type_ = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (NodeType -> Int) -> NodeType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NodeType -> Int
forall a. Enum a => a -> Int
fromEnum) NodeType
type_
Ptr Node
result <- CUInt -> IO (Ptr Node)
json_node_new CUInt
type_'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeNew" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "json_node_copy" json_node_copy ::
Ptr Node ->
IO (Ptr Node)
nodeCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Node
nodeCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Node
nodeCopy Node
node = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
result <- Ptr Node -> IO (Ptr Node)
json_node_copy Ptr Node
node'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeCopy" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeCopyMethodInfo
instance (signature ~ (m Node), MonadIO m) => O.OverloadedMethod NodeCopyMethodInfo Node signature where
overloadedMethod = nodeCopy
instance O.OverloadedMethodInfo NodeCopyMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeCopy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeCopy"
})
#endif
foreign import ccall "json_node_dup_array" json_node_dup_array ::
Ptr Node ->
IO (Ptr Json.Array.Array)
nodeDupArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe Json.Array.Array)
nodeDupArray :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Array)
nodeDupArray Node
node = IO (Maybe Array) -> m (Maybe Array)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Array) -> m (Maybe Array))
-> IO (Maybe Array) -> m (Maybe Array)
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Array
result <- Ptr Node -> IO (Ptr Array)
json_node_dup_array Ptr Node
node'
Maybe Array
maybeResult <- Ptr Array -> (Ptr Array -> IO Array) -> IO (Maybe Array)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Array
result ((Ptr Array -> IO Array) -> IO (Maybe Array))
-> (Ptr Array -> IO Array) -> IO (Maybe Array)
forall a b. (a -> b) -> a -> b
$ \Ptr Array
result' -> do
Array
result'' <- ((ManagedPtr Array -> Array) -> Ptr Array -> IO Array
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Array -> Array
Json.Array.Array) Ptr Array
result'
Array -> IO Array
forall (m :: * -> *) a. Monad m => a -> m a
return Array
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Array -> IO (Maybe Array)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Array
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeDupArrayMethodInfo
instance (signature ~ (m (Maybe Json.Array.Array)), MonadIO m) => O.OverloadedMethod NodeDupArrayMethodInfo Node signature where
overloadedMethod = nodeDupArray
instance O.OverloadedMethodInfo NodeDupArrayMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeDupArray",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeDupArray"
})
#endif
foreign import ccall "json_node_dup_object" json_node_dup_object ::
Ptr Node ->
IO (Ptr Json.Object.Object)
nodeDupObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe Json.Object.Object)
nodeDupObject :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Object)
nodeDupObject Node
node = IO (Maybe Object) -> m (Maybe Object)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Object) -> m (Maybe Object))
-> IO (Maybe Object) -> m (Maybe Object)
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Object
result <- Ptr Node -> IO (Ptr Object)
json_node_dup_object Ptr Node
node'
Maybe Object
maybeResult <- Ptr Object -> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Object
result ((Ptr Object -> IO Object) -> IO (Maybe Object))
-> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ \Ptr Object
result' -> do
Object
result'' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Object -> Object
Json.Object.Object) Ptr Object
result'
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeDupObjectMethodInfo
instance (signature ~ (m (Maybe Json.Object.Object)), MonadIO m) => O.OverloadedMethod NodeDupObjectMethodInfo Node signature where
overloadedMethod = nodeDupObject
instance O.OverloadedMethodInfo NodeDupObjectMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeDupObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeDupObject"
})
#endif
foreign import ccall "json_node_dup_string" json_node_dup_string ::
Ptr Node ->
IO CString
nodeDupString ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe T.Text)
nodeDupString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Text)
nodeDupString Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CString
result <- Ptr Node -> IO CString
json_node_dup_string Ptr Node
node'
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''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeDupStringMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod NodeDupStringMethodInfo Node signature where
overloadedMethod = nodeDupString
instance O.OverloadedMethodInfo NodeDupStringMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeDupString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeDupString"
})
#endif
foreign import ccall "json_node_equal" json_node_equal ::
Ptr Node ->
Ptr Node ->
IO CInt
nodeEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Node
-> m Bool
nodeEqual :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Node -> m Bool
nodeEqual Node
a Node
b = 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 Node
a' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
a
Ptr Node
b' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
b
CInt
result <- Ptr Node -> Ptr Node -> IO CInt
json_node_equal Ptr Node
a' Ptr Node
b'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
a
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
b
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NodeEqualMethodInfo
instance (signature ~ (Node -> m Bool), MonadIO m) => O.OverloadedMethod NodeEqualMethodInfo Node signature where
overloadedMethod = nodeEqual
instance O.OverloadedMethodInfo NodeEqualMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeEqual"
})
#endif
foreign import ccall "json_node_free" json_node_free ::
Ptr Node ->
IO ()
nodeFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m ()
nodeFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m ()
nodeFree Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node -> IO ()
json_node_free Ptr Node
node'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod NodeFreeMethodInfo Node signature where
overloadedMethod = nodeFree
instance O.OverloadedMethodInfo NodeFreeMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeFree",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeFree"
})
#endif
foreign import ccall "json_node_get_array" json_node_get_array ::
Ptr Node ->
IO (Ptr Json.Array.Array)
nodeGetArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe Json.Array.Array)
nodeGetArray :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Array)
nodeGetArray Node
node = IO (Maybe Array) -> m (Maybe Array)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Array) -> m (Maybe Array))
-> IO (Maybe Array) -> m (Maybe Array)
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Array
result <- Ptr Node -> IO (Ptr Array)
json_node_get_array Ptr Node
node'
Maybe Array
maybeResult <- Ptr Array -> (Ptr Array -> IO Array) -> IO (Maybe Array)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Array
result ((Ptr Array -> IO Array) -> IO (Maybe Array))
-> (Ptr Array -> IO Array) -> IO (Maybe Array)
forall a b. (a -> b) -> a -> b
$ \Ptr Array
result' -> do
Array
result'' <- ((ManagedPtr Array -> Array) -> Ptr Array -> IO Array
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Array -> Array
Json.Array.Array) Ptr Array
result'
Array -> IO Array
forall (m :: * -> *) a. Monad m => a -> m a
return Array
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Array -> IO (Maybe Array)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Array
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeGetArrayMethodInfo
instance (signature ~ (m (Maybe Json.Array.Array)), MonadIO m) => O.OverloadedMethod NodeGetArrayMethodInfo Node signature where
overloadedMethod = nodeGetArray
instance O.OverloadedMethodInfo NodeGetArrayMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetArray",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetArray"
})
#endif
foreign import ccall "json_node_get_boolean" json_node_get_boolean ::
Ptr Node ->
IO CInt
nodeGetBoolean ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Bool
nodeGetBoolean :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Bool
nodeGetBoolean Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CInt
result <- Ptr Node -> IO CInt
json_node_get_boolean Ptr Node
node'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NodeGetBooleanMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod NodeGetBooleanMethodInfo Node signature where
overloadedMethod = nodeGetBoolean
instance O.OverloadedMethodInfo NodeGetBooleanMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetBoolean"
})
#endif
foreign import ccall "json_node_get_double" json_node_get_double ::
Ptr Node ->
IO CDouble
nodeGetDouble ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Double
nodeGetDouble :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Double
nodeGetDouble Node
node = IO Double -> m Double
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Double -> m Double) -> IO Double -> m Double
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CDouble
result <- Ptr Node -> IO CDouble
json_node_get_double Ptr Node
node'
let result' :: Double
result' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Double -> IO Double
forall (m :: * -> *) a. Monad m => a -> m a
return Double
result'
#if defined(ENABLE_OVERLOADING)
data NodeGetDoubleMethodInfo
instance (signature ~ (m Double), MonadIO m) => O.OverloadedMethod NodeGetDoubleMethodInfo Node signature where
overloadedMethod = nodeGetDouble
instance O.OverloadedMethodInfo NodeGetDoubleMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetDouble",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetDouble"
})
#endif
foreign import ccall "json_node_get_int" json_node_get_int ::
Ptr Node ->
IO Int64
nodeGetInt ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Int64
nodeGetInt :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Int64
nodeGetInt Node
node = IO Int64 -> m Int64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Int64
result <- Ptr Node -> IO Int64
json_node_get_int Ptr Node
node'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Int64 -> IO Int64
forall (m :: * -> *) a. Monad m => a -> m a
return Int64
result
#if defined(ENABLE_OVERLOADING)
data NodeGetIntMethodInfo
instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod NodeGetIntMethodInfo Node signature where
overloadedMethod = nodeGetInt
instance O.OverloadedMethodInfo NodeGetIntMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetInt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetInt"
})
#endif
foreign import ccall "json_node_get_node_type" json_node_get_node_type ::
Ptr Node ->
IO CUInt
nodeGetNodeType ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Json.Enums.NodeType
nodeGetNodeType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m NodeType
nodeGetNodeType Node
node = IO NodeType -> m NodeType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NodeType -> m NodeType) -> IO NodeType -> m NodeType
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CUInt
result <- Ptr Node -> IO CUInt
json_node_get_node_type Ptr Node
node'
let result' :: NodeType
result' = (Int -> NodeType
forall a. Enum a => Int -> a
toEnum (Int -> NodeType) -> (CUInt -> Int) -> CUInt -> NodeType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
NodeType -> IO NodeType
forall (m :: * -> *) a. Monad m => a -> m a
return NodeType
result'
#if defined(ENABLE_OVERLOADING)
data NodeGetNodeTypeMethodInfo
instance (signature ~ (m Json.Enums.NodeType), MonadIO m) => O.OverloadedMethod NodeGetNodeTypeMethodInfo Node signature where
overloadedMethod = nodeGetNodeType
instance O.OverloadedMethodInfo NodeGetNodeTypeMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetNodeType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetNodeType"
})
#endif
foreign import ccall "json_node_get_object" json_node_get_object ::
Ptr Node ->
IO (Ptr Json.Object.Object)
nodeGetObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe Json.Object.Object)
nodeGetObject :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Object)
nodeGetObject Node
node = IO (Maybe Object) -> m (Maybe Object)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Object) -> m (Maybe Object))
-> IO (Maybe Object) -> m (Maybe Object)
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Object
result <- Ptr Node -> IO (Ptr Object)
json_node_get_object Ptr Node
node'
Maybe Object
maybeResult <- Ptr Object -> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Object
result ((Ptr Object -> IO Object) -> IO (Maybe Object))
-> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ \Ptr Object
result' -> do
Object
result'' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Object -> Object
Json.Object.Object) Ptr Object
result'
Object -> IO Object
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeGetObjectMethodInfo
instance (signature ~ (m (Maybe Json.Object.Object)), MonadIO m) => O.OverloadedMethod NodeGetObjectMethodInfo Node signature where
overloadedMethod = nodeGetObject
instance O.OverloadedMethodInfo NodeGetObjectMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetObject"
})
#endif
foreign import ccall "json_node_get_parent" json_node_get_parent ::
Ptr Node ->
IO (Ptr Node)
nodeGetParent ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe Node)
nodeGetParent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Node)
nodeGetParent Node
node = IO (Maybe Node) -> m (Maybe Node)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Node) -> m (Maybe Node))
-> IO (Maybe Node) -> m (Maybe Node)
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
result <- Ptr Node -> IO (Ptr Node)
json_node_get_parent Ptr Node
node'
Maybe Node
maybeResult <- Ptr Node -> (Ptr Node -> IO Node) -> IO (Maybe Node)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Node
result ((Ptr Node -> IO Node) -> IO (Maybe Node))
-> (Ptr Node -> IO Node) -> IO (Maybe Node)
forall a b. (a -> b) -> a -> b
$ \Ptr Node
result' -> do
Node
result'' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result'
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Node -> IO (Maybe Node)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Node
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeGetParentMethodInfo
instance (signature ~ (m (Maybe Node)), MonadIO m) => O.OverloadedMethod NodeGetParentMethodInfo Node signature where
overloadedMethod = nodeGetParent
instance O.OverloadedMethodInfo NodeGetParentMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetParent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetParent"
})
#endif
foreign import ccall "json_node_get_string" json_node_get_string ::
Ptr Node ->
IO CString
nodeGetString ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (Maybe T.Text)
nodeGetString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> m (Maybe Text)
nodeGetString Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CString
result <- Ptr Node -> IO CString
json_node_get_string Ptr Node
node'
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'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data NodeGetStringMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod NodeGetStringMethodInfo Node signature where
overloadedMethod = nodeGetString
instance O.OverloadedMethodInfo NodeGetStringMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetString"
})
#endif
foreign import ccall "json_node_get_value" json_node_get_value ::
Ptr Node ->
Ptr GValue ->
IO ()
nodeGetValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m (GValue)
nodeGetValue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m GValue
nodeGetValue Node
node = IO GValue -> m GValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
24 :: IO (Ptr GValue)
Ptr Node -> Ptr GValue -> IO ()
json_node_get_value Ptr Node
node' Ptr GValue
value
GValue
value' <- Ptr GValue -> IO GValue
B.GValue.wrapGValuePtr Ptr GValue
value
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
GValue -> IO GValue
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
value'
#if defined(ENABLE_OVERLOADING)
data NodeGetValueMethodInfo
instance (signature ~ (m (GValue)), MonadIO m) => O.OverloadedMethod NodeGetValueMethodInfo Node signature where
overloadedMethod = nodeGetValue
instance O.OverloadedMethodInfo NodeGetValueMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetValue"
})
#endif
foreign import ccall "json_node_get_value_type" json_node_get_value_type ::
Ptr Node ->
IO CGType
nodeGetValueType ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m GType
nodeGetValueType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m GType
nodeGetValueType Node
node = IO GType -> m GType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CGType
result <- Ptr Node -> IO CGType
json_node_get_value_type Ptr Node
node'
let result' :: GType
result' = CGType -> GType
GType CGType
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
GType -> IO GType
forall (m :: * -> *) a. Monad m => a -> m a
return GType
result'
#if defined(ENABLE_OVERLOADING)
data NodeGetValueTypeMethodInfo
instance (signature ~ (m GType), MonadIO m) => O.OverloadedMethod NodeGetValueTypeMethodInfo Node signature where
overloadedMethod = nodeGetValueType
instance O.OverloadedMethodInfo NodeGetValueTypeMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeGetValueType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeGetValueType"
})
#endif
foreign import ccall "json_node_hash" json_node_hash ::
Ptr Node ->
IO Word32
nodeHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Word32
nodeHash :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Word32
nodeHash Node
key = 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 Node
key' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
key
Word32
result <- Ptr Node -> IO Word32
json_node_hash Ptr Node
key'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
key
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data NodeHashMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod NodeHashMethodInfo Node signature where
overloadedMethod = nodeHash
instance O.OverloadedMethodInfo NodeHashMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeHash",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeHash"
})
#endif
foreign import ccall "json_node_init" json_node_init ::
Ptr Node ->
CUInt ->
IO (Ptr Node)
nodeInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Json.Enums.NodeType
-> m Node
nodeInit :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> NodeType -> m Node
nodeInit Node
node NodeType
type_ = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
let type_' :: CUInt
type_' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (NodeType -> Int) -> NodeType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NodeType -> Int
forall a. Enum a => a -> Int
fromEnum) NodeType
type_
Ptr Node
result <- Ptr Node -> CUInt -> IO (Ptr Node)
json_node_init Ptr Node
node' CUInt
type_'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInit" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitMethodInfo
instance (signature ~ (Json.Enums.NodeType -> m Node), MonadIO m) => O.OverloadedMethod NodeInitMethodInfo Node signature where
overloadedMethod = nodeInit
instance O.OverloadedMethodInfo NodeInitMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInit",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInit"
})
#endif
foreign import ccall "json_node_init_array" json_node_init_array ::
Ptr Node ->
Ptr Json.Array.Array ->
IO (Ptr Node)
nodeInitArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Maybe (Json.Array.Array)
-> m Node
nodeInitArray :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Maybe Array -> m Node
nodeInitArray Node
node Maybe Array
array = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Array
maybeArray <- case Maybe Array
array of
Maybe Array
Nothing -> Ptr Array -> IO (Ptr Array)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Array
forall a. Ptr a
nullPtr
Just Array
jArray -> do
Ptr Array
jArray' <- Array -> IO (Ptr Array)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Array
jArray
Ptr Array -> IO (Ptr Array)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Array
jArray'
Ptr Node
result <- Ptr Node -> Ptr Array -> IO (Ptr Node)
json_node_init_array Ptr Node
node' Ptr Array
maybeArray
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitArray" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Array -> (Array -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Array
array Array -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitArrayMethodInfo
instance (signature ~ (Maybe (Json.Array.Array) -> m Node), MonadIO m) => O.OverloadedMethod NodeInitArrayMethodInfo Node signature where
overloadedMethod = nodeInitArray
instance O.OverloadedMethodInfo NodeInitArrayMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitArray",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitArray"
})
#endif
foreign import ccall "json_node_init_boolean" json_node_init_boolean ::
Ptr Node ->
CInt ->
IO (Ptr Node)
nodeInitBoolean ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Bool
-> m Node
nodeInitBoolean :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Bool -> m Node
nodeInitBoolean Node
node Bool
value = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
let value' :: CInt
value' = (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
value
Ptr Node
result <- Ptr Node -> CInt -> IO (Ptr Node)
json_node_init_boolean Ptr Node
node' CInt
value'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitBoolean" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitBooleanMethodInfo
instance (signature ~ (Bool -> m Node), MonadIO m) => O.OverloadedMethod NodeInitBooleanMethodInfo Node signature where
overloadedMethod = nodeInitBoolean
instance O.OverloadedMethodInfo NodeInitBooleanMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitBoolean"
})
#endif
foreign import ccall "json_node_init_double" json_node_init_double ::
Ptr Node ->
CDouble ->
IO (Ptr Node)
nodeInitDouble ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Double
-> m Node
nodeInitDouble :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Double -> m Node
nodeInitDouble Node
node Double
value = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
let value' :: CDouble
value' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
value
Ptr Node
result <- Ptr Node -> CDouble -> IO (Ptr Node)
json_node_init_double Ptr Node
node' CDouble
value'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitDouble" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitDoubleMethodInfo
instance (signature ~ (Double -> m Node), MonadIO m) => O.OverloadedMethod NodeInitDoubleMethodInfo Node signature where
overloadedMethod = nodeInitDouble
instance O.OverloadedMethodInfo NodeInitDoubleMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitDouble",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitDouble"
})
#endif
foreign import ccall "json_node_init_int" json_node_init_int ::
Ptr Node ->
Int64 ->
IO (Ptr Node)
nodeInitInt ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Int64
-> m Node
nodeInitInt :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Int64 -> m Node
nodeInitInt Node
node Int64
value = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
result <- Ptr Node -> Int64 -> IO (Ptr Node)
json_node_init_int Ptr Node
node' Int64
value
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitInt" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitIntMethodInfo
instance (signature ~ (Int64 -> m Node), MonadIO m) => O.OverloadedMethod NodeInitIntMethodInfo Node signature where
overloadedMethod = nodeInitInt
instance O.OverloadedMethodInfo NodeInitIntMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitInt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitInt"
})
#endif
foreign import ccall "json_node_init_null" json_node_init_null ::
Ptr Node ->
IO (Ptr Node)
nodeInitNull ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Node
nodeInitNull :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Node
nodeInitNull Node
node = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
result <- Ptr Node -> IO (Ptr Node)
json_node_init_null Ptr Node
node'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitNull" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitNullMethodInfo
instance (signature ~ (m Node), MonadIO m) => O.OverloadedMethod NodeInitNullMethodInfo Node signature where
overloadedMethod = nodeInitNull
instance O.OverloadedMethodInfo NodeInitNullMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitNull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitNull"
})
#endif
foreign import ccall "json_node_init_object" json_node_init_object ::
Ptr Node ->
Ptr Json.Object.Object ->
IO (Ptr Node)
nodeInitObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Maybe (Json.Object.Object)
-> m Node
nodeInitObject :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Maybe Object -> m Node
nodeInitObject Node
node Maybe Object
object = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Object
maybeObject <- case Maybe Object
object of
Maybe Object
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
Just Object
jObject -> do
Ptr Object
jObject' <- Object -> IO (Ptr Object)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Object
jObject
Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jObject'
Ptr Node
result <- Ptr Node -> Ptr Object -> IO (Ptr Node)
json_node_init_object Ptr Node
node' Ptr Object
maybeObject
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitObject" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Object -> (Object -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Object
object Object -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitObjectMethodInfo
instance (signature ~ (Maybe (Json.Object.Object) -> m Node), MonadIO m) => O.OverloadedMethod NodeInitObjectMethodInfo Node signature where
overloadedMethod = nodeInitObject
instance O.OverloadedMethodInfo NodeInitObjectMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitObject"
})
#endif
foreign import ccall "json_node_init_string" json_node_init_string ::
Ptr Node ->
CString ->
IO (Ptr Node)
nodeInitString ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Maybe (T.Text)
-> m Node
nodeInitString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Maybe Text -> m Node
nodeInitString Node
node Maybe Text
value = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CString
maybeValue <- case Maybe Text
value of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jValue -> do
CString
jValue' <- Text -> IO CString
textToCString Text
jValue
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jValue'
Ptr Node
result <- Ptr Node -> CString -> IO (Ptr Node)
json_node_init_string Ptr Node
node' CString
maybeValue
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeInitString" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeValue
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeInitStringMethodInfo
instance (signature ~ (Maybe (T.Text) -> m Node), MonadIO m) => O.OverloadedMethod NodeInitStringMethodInfo Node signature where
overloadedMethod = nodeInitString
instance O.OverloadedMethodInfo NodeInitStringMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeInitString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeInitString"
})
#endif
foreign import ccall "json_node_is_immutable" json_node_is_immutable ::
Ptr Node ->
IO CInt
nodeIsImmutable ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Bool
nodeIsImmutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Bool
nodeIsImmutable Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CInt
result <- Ptr Node -> IO CInt
json_node_is_immutable Ptr Node
node'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NodeIsImmutableMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod NodeIsImmutableMethodInfo Node signature where
overloadedMethod = nodeIsImmutable
instance O.OverloadedMethodInfo NodeIsImmutableMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeIsImmutable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeIsImmutable"
})
#endif
foreign import ccall "json_node_is_null" json_node_is_null ::
Ptr Node ->
IO CInt
nodeIsNull ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Bool
nodeIsNull :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Bool
nodeIsNull Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CInt
result <- Ptr Node -> IO CInt
json_node_is_null Ptr Node
node'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data NodeIsNullMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod NodeIsNullMethodInfo Node signature where
overloadedMethod = nodeIsNull
instance O.OverloadedMethodInfo NodeIsNullMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeIsNull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeIsNull"
})
#endif
foreign import ccall "json_node_ref" json_node_ref ::
Ptr Node ->
IO (Ptr Node)
nodeRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m Node
nodeRef :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Node
nodeRef Node
node = IO Node -> m Node
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Node -> m Node) -> IO Node -> m Node
forall a b. (a -> b) -> a -> b
$ do
Ptr Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
result <- Ptr Node -> IO (Ptr Node)
json_node_ref Ptr Node
node'
Text -> Ptr Node -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeRef" Ptr Node
result
Node
result' <- ((ManagedPtr Node -> Node) -> Ptr Node -> IO Node
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Node -> Node
Node) Ptr Node
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Node -> IO Node
forall (m :: * -> *) a. Monad m => a -> m a
return Node
result'
#if defined(ENABLE_OVERLOADING)
data NodeRefMethodInfo
instance (signature ~ (m Node), MonadIO m) => O.OverloadedMethod NodeRefMethodInfo Node signature where
overloadedMethod = nodeRef
instance O.OverloadedMethodInfo NodeRefMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeRef",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeRef"
})
#endif
foreign import ccall "json_node_seal" json_node_seal ::
Ptr Node ->
IO ()
nodeSeal ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m ()
nodeSeal :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m ()
nodeSeal Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node -> IO ()
json_node_seal Ptr Node
node'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSealMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod NodeSealMethodInfo Node signature where
overloadedMethod = nodeSeal
instance O.OverloadedMethodInfo NodeSealMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSeal",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSeal"
})
#endif
foreign import ccall "json_node_set_array" json_node_set_array ::
Ptr Node ->
Ptr Json.Array.Array ->
IO ()
nodeSetArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Json.Array.Array
-> m ()
nodeSetArray :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Array -> m ()
nodeSetArray Node
node Array
array = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Array
array' <- Array -> IO (Ptr Array)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Array
array
Ptr Node -> Ptr Array -> IO ()
json_node_set_array Ptr Node
node' Ptr Array
array'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Array -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Array
array
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetArrayMethodInfo
instance (signature ~ (Json.Array.Array -> m ()), MonadIO m) => O.OverloadedMethod NodeSetArrayMethodInfo Node signature where
overloadedMethod = nodeSetArray
instance O.OverloadedMethodInfo NodeSetArrayMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetArray",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetArray"
})
#endif
foreign import ccall "json_node_set_boolean" json_node_set_boolean ::
Ptr Node ->
CInt ->
IO ()
nodeSetBoolean ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Bool
-> m ()
nodeSetBoolean :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Bool -> m ()
nodeSetBoolean Node
node Bool
value = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
let value' :: CInt
value' = (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
value
Ptr Node -> CInt -> IO ()
json_node_set_boolean Ptr Node
node' CInt
value'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetBooleanMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.OverloadedMethod NodeSetBooleanMethodInfo Node signature where
overloadedMethod = nodeSetBoolean
instance O.OverloadedMethodInfo NodeSetBooleanMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetBoolean"
})
#endif
foreign import ccall "json_node_set_double" json_node_set_double ::
Ptr Node ->
CDouble ->
IO ()
nodeSetDouble ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Double
-> m ()
nodeSetDouble :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Double -> m ()
nodeSetDouble Node
node Double
value = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
let value' :: CDouble
value' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
value
Ptr Node -> CDouble -> IO ()
json_node_set_double Ptr Node
node' CDouble
value'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetDoubleMethodInfo
instance (signature ~ (Double -> m ()), MonadIO m) => O.OverloadedMethod NodeSetDoubleMethodInfo Node signature where
overloadedMethod = nodeSetDouble
instance O.OverloadedMethodInfo NodeSetDoubleMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetDouble",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetDouble"
})
#endif
foreign import ccall "json_node_set_int" json_node_set_int ::
Ptr Node ->
Int64 ->
IO ()
nodeSetInt ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Int64
-> m ()
nodeSetInt :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Int64 -> m ()
nodeSetInt Node
node Int64
value = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node -> Int64 -> IO ()
json_node_set_int Ptr Node
node' Int64
value
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetIntMethodInfo
instance (signature ~ (Int64 -> m ()), MonadIO m) => O.OverloadedMethod NodeSetIntMethodInfo Node signature where
overloadedMethod = nodeSetInt
instance O.OverloadedMethodInfo NodeSetIntMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetInt",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetInt"
})
#endif
foreign import ccall "json_node_set_object" json_node_set_object ::
Ptr Node ->
Ptr Json.Object.Object ->
IO ()
nodeSetObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Maybe (Json.Object.Object)
-> m ()
nodeSetObject :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Maybe Object -> m ()
nodeSetObject Node
node Maybe Object
object = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Object
maybeObject <- case Maybe Object
object of
Maybe Object
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
Just Object
jObject -> do
Ptr Object
jObject' <- Object -> IO (Ptr Object)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Object
jObject
Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jObject'
Ptr Node -> Ptr Object -> IO ()
json_node_set_object Ptr Node
node' Ptr Object
maybeObject
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Object -> (Object -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Object
object Object -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetObjectMethodInfo
instance (signature ~ (Maybe (Json.Object.Object) -> m ()), MonadIO m) => O.OverloadedMethod NodeSetObjectMethodInfo Node signature where
overloadedMethod = nodeSetObject
instance O.OverloadedMethodInfo NodeSetObjectMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetObject"
})
#endif
foreign import ccall "json_node_set_parent" json_node_set_parent ::
Ptr Node ->
Ptr Node ->
IO ()
nodeSetParent ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Maybe (Node)
-> m ()
nodeSetParent :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Maybe Node -> m ()
nodeSetParent Node
node Maybe Node
parent = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Node
maybeParent <- case Maybe Node
parent of
Maybe Node
Nothing -> Ptr Node -> IO (Ptr Node)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Node
forall a. Ptr a
nullPtr
Just Node
jParent -> do
Ptr Node
jParent' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
jParent
Ptr Node -> IO (Ptr Node)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Node
jParent'
Ptr Node -> Ptr Node -> IO ()
json_node_set_parent Ptr Node
node' Ptr Node
maybeParent
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Maybe Node -> (Node -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Node
parent Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetParentMethodInfo
instance (signature ~ (Maybe (Node) -> m ()), MonadIO m) => O.OverloadedMethod NodeSetParentMethodInfo Node signature where
overloadedMethod = nodeSetParent
instance O.OverloadedMethodInfo NodeSetParentMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetParent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetParent"
})
#endif
foreign import ccall "json_node_set_string" json_node_set_string ::
Ptr Node ->
CString ->
IO ()
nodeSetString ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> T.Text
-> m ()
nodeSetString :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Text -> m ()
nodeSetString Node
node Text
value = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CString
value' <- Text -> IO CString
textToCString Text
value
Ptr Node -> CString -> IO ()
json_node_set_string Ptr Node
node' CString
value'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetStringMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m) => O.OverloadedMethod NodeSetStringMethodInfo Node signature where
overloadedMethod = nodeSetString
instance O.OverloadedMethodInfo NodeSetStringMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetString"
})
#endif
foreign import ccall "json_node_set_value" json_node_set_value ::
Ptr Node ->
Ptr GValue ->
IO ()
nodeSetValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> GValue
-> m ()
nodeSetValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> GValue -> m ()
nodeSetValue Node
node GValue
value = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
Ptr Node -> Ptr GValue -> IO ()
json_node_set_value Ptr Node
node' Ptr GValue
value'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeSetValueMethodInfo
instance (signature ~ (GValue -> m ()), MonadIO m) => O.OverloadedMethod NodeSetValueMethodInfo Node signature where
overloadedMethod = nodeSetValue
instance O.OverloadedMethodInfo NodeSetValueMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeSetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeSetValue"
})
#endif
foreign import ccall "json_node_take_array" json_node_take_array ::
Ptr Node ->
Ptr Json.Array.Array ->
IO ()
nodeTakeArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Json.Array.Array
-> m ()
nodeTakeArray :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Array -> m ()
nodeTakeArray Node
node Array
array = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Array
array' <- Array -> IO (Ptr Array)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Array
array
Ptr Node -> Ptr Array -> IO ()
json_node_take_array Ptr Node
node' Ptr Array
array'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Array -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Array
array
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeTakeArrayMethodInfo
instance (signature ~ (Json.Array.Array -> m ()), MonadIO m) => O.OverloadedMethod NodeTakeArrayMethodInfo Node signature where
overloadedMethod = nodeTakeArray
instance O.OverloadedMethodInfo NodeTakeArrayMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeTakeArray",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeTakeArray"
})
#endif
foreign import ccall "json_node_take_object" json_node_take_object ::
Ptr Node ->
Ptr Json.Object.Object ->
IO ()
nodeTakeObject ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> Json.Object.Object
-> m ()
nodeTakeObject :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Node -> Object -> m ()
nodeTakeObject Node
node Object
object = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
Ptr Object
object' <- Object -> IO (Ptr Object)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Object
object
Ptr Node -> Ptr Object -> IO ()
json_node_take_object Ptr Node
node' Ptr Object
object'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Object -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Object
object
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeTakeObjectMethodInfo
instance (signature ~ (Json.Object.Object -> m ()), MonadIO m) => O.OverloadedMethod NodeTakeObjectMethodInfo Node signature where
overloadedMethod = nodeTakeObject
instance O.OverloadedMethodInfo NodeTakeObjectMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeTakeObject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeTakeObject"
})
#endif
foreign import ccall "json_node_type_name" json_node_type_name ::
Ptr Node ->
IO CString
nodeTypeName ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m T.Text
nodeTypeName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m Text
nodeTypeName Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Node
node
CString
result <- Ptr Node -> IO CString
json_node_type_name Ptr Node
node'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"nodeTypeName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data NodeTypeNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod NodeTypeNameMethodInfo Node signature where
overloadedMethod = nodeTypeName
instance O.OverloadedMethodInfo NodeTypeNameMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeTypeName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeTypeName"
})
#endif
foreign import ccall "json_node_unref" json_node_unref ::
Ptr Node ->
IO ()
nodeUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
Node
-> m ()
nodeUnref :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Node -> m ()
nodeUnref Node
node = 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 Node
node' <- Node -> IO (Ptr Node)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Node
node
Ptr Node -> IO ()
json_node_unref Ptr Node
node'
Node -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Node
node
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data NodeUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod NodeUnrefMethodInfo Node signature where
overloadedMethod = nodeUnref
instance O.OverloadedMethodInfo NodeUnrefMethodInfo Node where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Json.Structs.Node.nodeUnref",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-json-1.0.2/docs/GI-Json-Structs-Node.html#v:nodeUnref"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveNodeMethod (t :: Symbol) (o :: *) :: * where
ResolveNodeMethod "copy" o = NodeCopyMethodInfo
ResolveNodeMethod "dupArray" o = NodeDupArrayMethodInfo
ResolveNodeMethod "dupObject" o = NodeDupObjectMethodInfo
ResolveNodeMethod "dupString" o = NodeDupStringMethodInfo
ResolveNodeMethod "equal" o = NodeEqualMethodInfo
ResolveNodeMethod "free" o = NodeFreeMethodInfo
ResolveNodeMethod "hash" o = NodeHashMethodInfo
ResolveNodeMethod "init" o = NodeInitMethodInfo
ResolveNodeMethod "initArray" o = NodeInitArrayMethodInfo
ResolveNodeMethod "initBoolean" o = NodeInitBooleanMethodInfo
ResolveNodeMethod "initDouble" o = NodeInitDoubleMethodInfo
ResolveNodeMethod "initInt" o = NodeInitIntMethodInfo
ResolveNodeMethod "initNull" o = NodeInitNullMethodInfo
ResolveNodeMethod "initObject" o = NodeInitObjectMethodInfo
ResolveNodeMethod "initString" o = NodeInitStringMethodInfo
ResolveNodeMethod "isImmutable" o = NodeIsImmutableMethodInfo
ResolveNodeMethod "isNull" o = NodeIsNullMethodInfo
ResolveNodeMethod "ref" o = NodeRefMethodInfo
ResolveNodeMethod "seal" o = NodeSealMethodInfo
ResolveNodeMethod "takeArray" o = NodeTakeArrayMethodInfo
ResolveNodeMethod "takeObject" o = NodeTakeObjectMethodInfo
ResolveNodeMethod "typeName" o = NodeTypeNameMethodInfo
ResolveNodeMethod "unref" o = NodeUnrefMethodInfo
ResolveNodeMethod "getArray" o = NodeGetArrayMethodInfo
ResolveNodeMethod "getBoolean" o = NodeGetBooleanMethodInfo
ResolveNodeMethod "getDouble" o = NodeGetDoubleMethodInfo
ResolveNodeMethod "getInt" o = NodeGetIntMethodInfo
ResolveNodeMethod "getNodeType" o = NodeGetNodeTypeMethodInfo
ResolveNodeMethod "getObject" o = NodeGetObjectMethodInfo
ResolveNodeMethod "getParent" o = NodeGetParentMethodInfo
ResolveNodeMethod "getString" o = NodeGetStringMethodInfo
ResolveNodeMethod "getValue" o = NodeGetValueMethodInfo
ResolveNodeMethod "getValueType" o = NodeGetValueTypeMethodInfo
ResolveNodeMethod "setArray" o = NodeSetArrayMethodInfo
ResolveNodeMethod "setBoolean" o = NodeSetBooleanMethodInfo
ResolveNodeMethod "setDouble" o = NodeSetDoubleMethodInfo
ResolveNodeMethod "setInt" o = NodeSetIntMethodInfo
ResolveNodeMethod "setObject" o = NodeSetObjectMethodInfo
ResolveNodeMethod "setParent" o = NodeSetParentMethodInfo
ResolveNodeMethod "setString" o = NodeSetStringMethodInfo
ResolveNodeMethod "setValue" o = NodeSetValueMethodInfo
ResolveNodeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNodeMethod t Node, O.OverloadedMethod info Node p) => OL.IsLabel t (Node -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveNodeMethod t Node, O.OverloadedMethod info Node p, R.HasField t Node p) => R.HasField t Node p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveNodeMethod t Node, O.OverloadedMethodInfo info Node) => OL.IsLabel t (O.MethodProxy info Node) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif