module GI.Ggit.Structs.Submodule
(
Submodule(..) ,
noSubmodule ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetFetchRecurseMethodInfo ,
#endif
submoduleGetFetchRecurse ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetHeadIdMethodInfo ,
#endif
submoduleGetHeadId ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetIgnoreMethodInfo ,
#endif
submoduleGetIgnore ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetIndexIdMethodInfo ,
#endif
submoduleGetIndexId ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetNameMethodInfo ,
#endif
submoduleGetName ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetOwnerMethodInfo ,
#endif
submoduleGetOwner ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetPathMethodInfo ,
#endif
submoduleGetPath ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetUpdateMethodInfo ,
#endif
submoduleGetUpdate ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetUrlMethodInfo ,
#endif
submoduleGetUrl ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleGetWorkdirIdMethodInfo ,
#endif
submoduleGetWorkdirId ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleInitMethodInfo ,
#endif
submoduleInit ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleOpenMethodInfo ,
#endif
submoduleOpen ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleRefMethodInfo ,
#endif
submoduleRef ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleReloadMethodInfo ,
#endif
submoduleReload ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleSyncMethodInfo ,
#endif
submoduleSync ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
SubmoduleUnrefMethodInfo ,
#endif
submoduleUnref ,
) 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.Ggit.Enums as Ggit.Enums
import qualified GI.Ggit.Objects.Repository as Ggit.Repository
import qualified GI.Ggit.Structs.OId as Ggit.OId
newtype Submodule = Submodule (ManagedPtr Submodule)
foreign import ccall "ggit_submodule_get_type" c_ggit_submodule_get_type ::
IO GType
instance BoxedObject Submodule where
boxedType _ = c_ggit_submodule_get_type
noSubmodule :: Maybe Submodule
noSubmodule = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Submodule
type instance O.AttributeList Submodule = SubmoduleAttributeList
type SubmoduleAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_submodule_get_fetch_recurse" ggit_submodule_get_fetch_recurse ::
Ptr Submodule ->
IO CInt
submoduleGetFetchRecurse ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Bool
submoduleGetFetchRecurse submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_fetch_recurse submodule'
let result' = (/= 0) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetFetchRecurseMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo SubmoduleGetFetchRecurseMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetFetchRecurse
#endif
foreign import ccall "ggit_submodule_get_head_id" ggit_submodule_get_head_id ::
Ptr Submodule ->
IO (Ptr Ggit.OId.OId)
submoduleGetHeadId ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Ggit.OId.OId
submoduleGetHeadId submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_head_id submodule'
checkUnexpectedReturnNULL "submoduleGetHeadId" result
result' <- (wrapBoxed Ggit.OId.OId) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetHeadIdMethodInfo
instance (signature ~ (m Ggit.OId.OId), MonadIO m) => O.MethodInfo SubmoduleGetHeadIdMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetHeadId
#endif
foreign import ccall "ggit_submodule_get_ignore" ggit_submodule_get_ignore ::
Ptr Submodule ->
IO CUInt
submoduleGetIgnore ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Ggit.Enums.SubmoduleIgnore
submoduleGetIgnore submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_ignore submodule'
let result' = (toEnum . fromIntegral) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetIgnoreMethodInfo
instance (signature ~ (m Ggit.Enums.SubmoduleIgnore), MonadIO m) => O.MethodInfo SubmoduleGetIgnoreMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetIgnore
#endif
foreign import ccall "ggit_submodule_get_index_id" ggit_submodule_get_index_id ::
Ptr Submodule ->
IO (Ptr Ggit.OId.OId)
submoduleGetIndexId ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m (Maybe Ggit.OId.OId)
submoduleGetIndexId submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_index_id submodule'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr submodule
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetIndexIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo SubmoduleGetIndexIdMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetIndexId
#endif
foreign import ccall "ggit_submodule_get_name" ggit_submodule_get_name ::
Ptr Submodule ->
IO CString
submoduleGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m T.Text
submoduleGetName submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_name submodule'
checkUnexpectedReturnNULL "submoduleGetName" result
result' <- cstringToText result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo SubmoduleGetNameMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetName
#endif
foreign import ccall "ggit_submodule_get_owner" ggit_submodule_get_owner ::
Ptr Submodule ->
IO (Ptr Ggit.Repository.Repository)
submoduleGetOwner ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Ggit.Repository.Repository
submoduleGetOwner submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_owner submodule'
checkUnexpectedReturnNULL "submoduleGetOwner" result
result' <- (wrapObject Ggit.Repository.Repository) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetOwnerMethodInfo
instance (signature ~ (m Ggit.Repository.Repository), MonadIO m) => O.MethodInfo SubmoduleGetOwnerMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetOwner
#endif
foreign import ccall "ggit_submodule_get_path" ggit_submodule_get_path ::
Ptr Submodule ->
IO CString
submoduleGetPath ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m T.Text
submoduleGetPath submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_path submodule'
checkUnexpectedReturnNULL "submoduleGetPath" result
result' <- cstringToText result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo SubmoduleGetPathMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetPath
#endif
foreign import ccall "ggit_submodule_get_update" ggit_submodule_get_update ::
Ptr Submodule ->
IO CUInt
submoduleGetUpdate ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Ggit.Enums.SubmoduleUpdate
submoduleGetUpdate submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_update submodule'
let result' = (toEnum . fromIntegral) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetUpdateMethodInfo
instance (signature ~ (m Ggit.Enums.SubmoduleUpdate), MonadIO m) => O.MethodInfo SubmoduleGetUpdateMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetUpdate
#endif
foreign import ccall "ggit_submodule_get_url" ggit_submodule_get_url ::
Ptr Submodule ->
IO CString
submoduleGetUrl ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m T.Text
submoduleGetUrl submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_url submodule'
checkUnexpectedReturnNULL "submoduleGetUrl" result
result' <- cstringToText result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetUrlMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo SubmoduleGetUrlMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetUrl
#endif
foreign import ccall "ggit_submodule_get_workdir_id" ggit_submodule_get_workdir_id ::
Ptr Submodule ->
IO (Ptr Ggit.OId.OId)
submoduleGetWorkdirId ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m (Maybe Ggit.OId.OId)
submoduleGetWorkdirId submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_get_workdir_id submodule'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (wrapBoxed Ggit.OId.OId) result'
return result''
touchManagedPtr submodule
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleGetWorkdirIdMethodInfo
instance (signature ~ (m (Maybe Ggit.OId.OId)), MonadIO m) => O.MethodInfo SubmoduleGetWorkdirIdMethodInfo Submodule signature where
overloadedMethod _ = submoduleGetWorkdirId
#endif
foreign import ccall "ggit_submodule_init" ggit_submodule_init ::
Ptr Submodule ->
CInt ->
Ptr (Ptr GError) ->
IO ()
submoduleInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> Bool
-> m ()
submoduleInit submodule overwrite = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
let overwrite' = (fromIntegral . fromEnum) overwrite
onException (do
propagateGError $ ggit_submodule_init submodule' overwrite'
touchManagedPtr submodule
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleInitMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo SubmoduleInitMethodInfo Submodule signature where
overloadedMethod _ = submoduleInit
#endif
foreign import ccall "ggit_submodule_open" ggit_submodule_open ::
Ptr Submodule ->
Ptr (Ptr GError) ->
IO (Ptr Ggit.Repository.Repository)
submoduleOpen ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Ggit.Repository.Repository
submoduleOpen submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
onException (do
result <- propagateGError $ ggit_submodule_open submodule'
checkUnexpectedReturnNULL "submoduleOpen" result
result' <- (wrapObject Ggit.Repository.Repository) result
touchManagedPtr submodule
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleOpenMethodInfo
instance (signature ~ (m Ggit.Repository.Repository), MonadIO m) => O.MethodInfo SubmoduleOpenMethodInfo Submodule signature where
overloadedMethod _ = submoduleOpen
#endif
foreign import ccall "ggit_submodule_ref" ggit_submodule_ref ::
Ptr Submodule ->
IO (Ptr Submodule)
submoduleRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m Submodule
submoduleRef submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
result <- ggit_submodule_ref submodule'
checkUnexpectedReturnNULL "submoduleRef" result
result' <- (newBoxed Submodule) result
touchManagedPtr submodule
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleRefMethodInfo
instance (signature ~ (m Submodule), MonadIO m) => O.MethodInfo SubmoduleRefMethodInfo Submodule signature where
overloadedMethod _ = submoduleRef
#endif
foreign import ccall "ggit_submodule_reload" ggit_submodule_reload ::
Ptr Submodule ->
CInt ->
Ptr (Ptr GError) ->
IO ()
submoduleReload ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> Bool
-> m ()
submoduleReload submodule force = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
let force' = (fromIntegral . fromEnum) force
onException (do
propagateGError $ ggit_submodule_reload submodule' force'
touchManagedPtr submodule
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleReloadMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m) => O.MethodInfo SubmoduleReloadMethodInfo Submodule signature where
overloadedMethod _ = submoduleReload
#endif
foreign import ccall "ggit_submodule_sync" ggit_submodule_sync ::
Ptr Submodule ->
Ptr (Ptr GError) ->
IO ()
submoduleSync ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m ()
submoduleSync submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
onException (do
propagateGError $ ggit_submodule_sync submodule'
touchManagedPtr submodule
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleSyncMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo SubmoduleSyncMethodInfo Submodule signature where
overloadedMethod _ = submoduleSync
#endif
foreign import ccall "ggit_submodule_unref" ggit_submodule_unref ::
Ptr Submodule ->
IO ()
submoduleUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
Submodule
-> m ()
submoduleUnref submodule = liftIO $ do
submodule' <- unsafeManagedPtrGetPtr submodule
ggit_submodule_unref submodule'
touchManagedPtr submodule
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data SubmoduleUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo SubmoduleUnrefMethodInfo Submodule signature where
overloadedMethod _ = submoduleUnref
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveSubmoduleMethod (t :: Symbol) (o :: *) :: * where
ResolveSubmoduleMethod "init" o = SubmoduleInitMethodInfo
ResolveSubmoduleMethod "open" o = SubmoduleOpenMethodInfo
ResolveSubmoduleMethod "ref" o = SubmoduleRefMethodInfo
ResolveSubmoduleMethod "reload" o = SubmoduleReloadMethodInfo
ResolveSubmoduleMethod "sync" o = SubmoduleSyncMethodInfo
ResolveSubmoduleMethod "unref" o = SubmoduleUnrefMethodInfo
ResolveSubmoduleMethod "getFetchRecurse" o = SubmoduleGetFetchRecurseMethodInfo
ResolveSubmoduleMethod "getHeadId" o = SubmoduleGetHeadIdMethodInfo
ResolveSubmoduleMethod "getIgnore" o = SubmoduleGetIgnoreMethodInfo
ResolveSubmoduleMethod "getIndexId" o = SubmoduleGetIndexIdMethodInfo
ResolveSubmoduleMethod "getName" o = SubmoduleGetNameMethodInfo
ResolveSubmoduleMethod "getOwner" o = SubmoduleGetOwnerMethodInfo
ResolveSubmoduleMethod "getPath" o = SubmoduleGetPathMethodInfo
ResolveSubmoduleMethod "getUpdate" o = SubmoduleGetUpdateMethodInfo
ResolveSubmoduleMethod "getUrl" o = SubmoduleGetUrlMethodInfo
ResolveSubmoduleMethod "getWorkdirId" o = SubmoduleGetWorkdirIdMethodInfo
ResolveSubmoduleMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSubmoduleMethod t Submodule, O.MethodInfo info Submodule p) => O.IsLabelProxy t (Submodule -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSubmoduleMethod t Submodule, O.MethodInfo info Submodule p) => O.IsLabel t (Submodule -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif