{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Ggit.Objects.CloneOptions
(
CloneOptions(..) ,
IsCloneOptions ,
toCloneOptions ,
#if defined(ENABLE_OVERLOADING)
ResolveCloneOptionsMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CloneOptionsGetCheckoutBranchMethodInfo ,
#endif
cloneOptionsGetCheckoutBranch ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsGetFetchOptionsMethodInfo ,
#endif
cloneOptionsGetFetchOptions ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsGetIsBareMethodInfo ,
#endif
cloneOptionsGetIsBare ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsGetLocalMethodInfo ,
#endif
cloneOptionsGetLocal ,
cloneOptionsNew ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsSetCheckoutBranchMethodInfo ,
#endif
cloneOptionsSetCheckoutBranch ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsSetFetchOptionsMethodInfo ,
#endif
cloneOptionsSetFetchOptions ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsSetIsBareMethodInfo ,
#endif
cloneOptionsSetIsBare ,
#if defined(ENABLE_OVERLOADING)
CloneOptionsSetLocalMethodInfo ,
#endif
cloneOptionsSetLocal ,
) 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.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 qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Ggit.Enums as Ggit.Enums
import {-# SOURCE #-} qualified GI.Ggit.Structs.FetchOptions as Ggit.FetchOptions
newtype CloneOptions = CloneOptions (SP.ManagedPtr CloneOptions)
deriving (CloneOptions -> CloneOptions -> Bool
(CloneOptions -> CloneOptions -> Bool)
-> (CloneOptions -> CloneOptions -> Bool) -> Eq CloneOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloneOptions -> CloneOptions -> Bool
$c/= :: CloneOptions -> CloneOptions -> Bool
== :: CloneOptions -> CloneOptions -> Bool
$c== :: CloneOptions -> CloneOptions -> Bool
Eq)
instance SP.ManagedPtrNewtype CloneOptions where
toManagedPtr :: CloneOptions -> ManagedPtr CloneOptions
toManagedPtr (CloneOptions ManagedPtr CloneOptions
p) = ManagedPtr CloneOptions
p
foreign import ccall "ggit_clone_options_get_type"
c_ggit_clone_options_get_type :: IO B.Types.GType
instance B.Types.TypedObject CloneOptions where
glibType :: IO GType
glibType = IO GType
c_ggit_clone_options_get_type
instance B.Types.GObject CloneOptions
class (SP.GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o
instance (SP.GObject o, O.IsDescendantOf CloneOptions o) => IsCloneOptions o
instance O.HasParentTypes CloneOptions
type instance O.ParentTypes CloneOptions = '[GObject.Object.Object]
toCloneOptions :: (MIO.MonadIO m, IsCloneOptions o) => o -> m CloneOptions
toCloneOptions :: forall (m :: * -> *) o.
(MonadIO m, IsCloneOptions o) =>
o -> m CloneOptions
toCloneOptions = IO CloneOptions -> m CloneOptions
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CloneOptions -> m CloneOptions)
-> (o -> IO CloneOptions) -> o -> m CloneOptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CloneOptions -> CloneOptions) -> o -> IO CloneOptions
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr CloneOptions -> CloneOptions
CloneOptions
instance B.GValue.IsGValue (Maybe CloneOptions) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ggit_clone_options_get_type
gvalueSet_ :: Ptr GValue -> Maybe CloneOptions -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CloneOptions
P.Nothing = Ptr GValue -> Ptr CloneOptions -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CloneOptions
forall a. Ptr a
FP.nullPtr :: FP.Ptr CloneOptions)
gvalueSet_ Ptr GValue
gv (P.Just CloneOptions
obj) = CloneOptions -> (Ptr CloneOptions -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CloneOptions
obj (Ptr GValue -> Ptr CloneOptions -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe CloneOptions)
gvalueGet_ Ptr GValue
gv = do
Ptr CloneOptions
ptr <- Ptr GValue -> IO (Ptr CloneOptions)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CloneOptions)
if Ptr CloneOptions
ptr Ptr CloneOptions -> Ptr CloneOptions -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr CloneOptions
forall a. Ptr a
FP.nullPtr
then CloneOptions -> Maybe CloneOptions
forall a. a -> Maybe a
P.Just (CloneOptions -> Maybe CloneOptions)
-> IO CloneOptions -> IO (Maybe CloneOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr CloneOptions -> CloneOptions)
-> Ptr CloneOptions -> IO CloneOptions
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr CloneOptions -> CloneOptions
CloneOptions Ptr CloneOptions
ptr
else Maybe CloneOptions -> IO (Maybe CloneOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CloneOptions
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCloneOptionsMethod (t :: Symbol) (o :: *) :: * where
ResolveCloneOptionsMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCloneOptionsMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCloneOptionsMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCloneOptionsMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCloneOptionsMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCloneOptionsMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCloneOptionsMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCloneOptionsMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCloneOptionsMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCloneOptionsMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCloneOptionsMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCloneOptionsMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCloneOptionsMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCloneOptionsMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCloneOptionsMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCloneOptionsMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCloneOptionsMethod "getCheckoutBranch" o = CloneOptionsGetCheckoutBranchMethodInfo
ResolveCloneOptionsMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCloneOptionsMethod "getFetchOptions" o = CloneOptionsGetFetchOptionsMethodInfo
ResolveCloneOptionsMethod "getIsBare" o = CloneOptionsGetIsBareMethodInfo
ResolveCloneOptionsMethod "getLocal" o = CloneOptionsGetLocalMethodInfo
ResolveCloneOptionsMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCloneOptionsMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCloneOptionsMethod "setCheckoutBranch" o = CloneOptionsSetCheckoutBranchMethodInfo
ResolveCloneOptionsMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCloneOptionsMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCloneOptionsMethod "setFetchOptions" o = CloneOptionsSetFetchOptionsMethodInfo
ResolveCloneOptionsMethod "setIsBare" o = CloneOptionsSetIsBareMethodInfo
ResolveCloneOptionsMethod "setLocal" o = CloneOptionsSetLocalMethodInfo
ResolveCloneOptionsMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCloneOptionsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCloneOptionsMethod t CloneOptions, O.OverloadedMethod info CloneOptions p) => OL.IsLabel t (CloneOptions -> 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 ~ ResolveCloneOptionsMethod t CloneOptions, O.OverloadedMethod info CloneOptions p, R.HasField t CloneOptions p) => R.HasField t CloneOptions p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCloneOptionsMethod t CloneOptions, O.OverloadedMethodInfo info CloneOptions) => OL.IsLabel t (O.MethodProxy info CloneOptions) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CloneOptions
type instance O.AttributeList CloneOptions = CloneOptionsAttributeList
type CloneOptionsAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CloneOptions = CloneOptionsSignalList
type CloneOptionsSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_clone_options_new" ggit_clone_options_new ::
IO (Ptr CloneOptions)
cloneOptionsNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m CloneOptions
cloneOptionsNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m CloneOptions
cloneOptionsNew = IO CloneOptions -> m CloneOptions
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CloneOptions -> m CloneOptions)
-> IO CloneOptions -> m CloneOptions
forall a b. (a -> b) -> a -> b
$ do
Ptr CloneOptions
result <- IO (Ptr CloneOptions)
ggit_clone_options_new
Text -> Ptr CloneOptions -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cloneOptionsNew" Ptr CloneOptions
result
CloneOptions
result' <- ((ManagedPtr CloneOptions -> CloneOptions)
-> Ptr CloneOptions -> IO CloneOptions
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr CloneOptions -> CloneOptions
CloneOptions) Ptr CloneOptions
result
CloneOptions -> IO CloneOptions
forall (m :: * -> *) a. Monad m => a -> m a
return CloneOptions
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ggit_clone_options_get_checkout_branch" ggit_clone_options_get_checkout_branch ::
Ptr CloneOptions ->
IO CString
cloneOptionsGetCheckoutBranch ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m T.Text
cloneOptionsGetCheckoutBranch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> m Text
cloneOptionsGetCheckoutBranch a
options = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
CString
result <- Ptr CloneOptions -> IO CString
ggit_clone_options_get_checkout_branch Ptr CloneOptions
options'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cloneOptionsGetCheckoutBranch" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data CloneOptionsGetCheckoutBranchMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsGetCheckoutBranchMethodInfo a signature where
overloadedMethod = cloneOptionsGetCheckoutBranch
instance O.OverloadedMethodInfo CloneOptionsGetCheckoutBranchMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsGetCheckoutBranch",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsGetCheckoutBranch"
}
#endif
foreign import ccall "ggit_clone_options_get_fetch_options" ggit_clone_options_get_fetch_options ::
Ptr CloneOptions ->
IO (Ptr Ggit.FetchOptions.FetchOptions)
cloneOptionsGetFetchOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Ggit.FetchOptions.FetchOptions
cloneOptionsGetFetchOptions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> m FetchOptions
cloneOptionsGetFetchOptions a
options = IO FetchOptions -> m FetchOptions
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FetchOptions -> m FetchOptions)
-> IO FetchOptions -> m FetchOptions
forall a b. (a -> b) -> a -> b
$ do
Ptr CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
Ptr FetchOptions
result <- Ptr CloneOptions -> IO (Ptr FetchOptions)
ggit_clone_options_get_fetch_options Ptr CloneOptions
options'
Text -> Ptr FetchOptions -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cloneOptionsGetFetchOptions" Ptr FetchOptions
result
FetchOptions
result' <- ((ManagedPtr FetchOptions -> FetchOptions)
-> Ptr FetchOptions -> IO FetchOptions
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr FetchOptions -> FetchOptions
Ggit.FetchOptions.FetchOptions) Ptr FetchOptions
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
FetchOptions -> IO FetchOptions
forall (m :: * -> *) a. Monad m => a -> m a
return FetchOptions
result'
#if defined(ENABLE_OVERLOADING)
data CloneOptionsGetFetchOptionsMethodInfo
instance (signature ~ (m Ggit.FetchOptions.FetchOptions), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsGetFetchOptionsMethodInfo a signature where
overloadedMethod = cloneOptionsGetFetchOptions
instance O.OverloadedMethodInfo CloneOptionsGetFetchOptionsMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsGetFetchOptions",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsGetFetchOptions"
}
#endif
foreign import ccall "ggit_clone_options_get_is_bare" ggit_clone_options_get_is_bare ::
Ptr CloneOptions ->
IO CInt
cloneOptionsGetIsBare ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Bool
cloneOptionsGetIsBare :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> m Bool
cloneOptionsGetIsBare a
options = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
CInt
result <- Ptr CloneOptions -> IO CInt
ggit_clone_options_get_is_bare Ptr CloneOptions
options'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CloneOptionsGetIsBareMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsGetIsBareMethodInfo a signature where
overloadedMethod = cloneOptionsGetIsBare
instance O.OverloadedMethodInfo CloneOptionsGetIsBareMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsGetIsBare",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsGetIsBare"
}
#endif
foreign import ccall "ggit_clone_options_get_local" ggit_clone_options_get_local ::
Ptr CloneOptions ->
IO CUInt
cloneOptionsGetLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> m Ggit.Enums.CloneLocal
cloneOptionsGetLocal :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> m CloneLocal
cloneOptionsGetLocal a
options = IO CloneLocal -> m CloneLocal
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CloneLocal -> m CloneLocal) -> IO CloneLocal -> m CloneLocal
forall a b. (a -> b) -> a -> b
$ do
Ptr CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
CUInt
result <- Ptr CloneOptions -> IO CUInt
ggit_clone_options_get_local Ptr CloneOptions
options'
let result' :: CloneLocal
result' = (Int -> CloneLocal
forall a. Enum a => Int -> a
toEnum (Int -> CloneLocal) -> (CUInt -> Int) -> CUInt -> CloneLocal
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
CloneLocal -> IO CloneLocal
forall (m :: * -> *) a. Monad m => a -> m a
return CloneLocal
result'
#if defined(ENABLE_OVERLOADING)
data CloneOptionsGetLocalMethodInfo
instance (signature ~ (m Ggit.Enums.CloneLocal), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsGetLocalMethodInfo a signature where
overloadedMethod = cloneOptionsGetLocal
instance O.OverloadedMethodInfo CloneOptionsGetLocalMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsGetLocal",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsGetLocal"
}
#endif
foreign import ccall "ggit_clone_options_set_checkout_branch" ggit_clone_options_set_checkout_branch ::
Ptr CloneOptions ->
CString ->
IO ()
cloneOptionsSetCheckoutBranch ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Maybe (T.Text)
-> m ()
cloneOptionsSetCheckoutBranch :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> Maybe Text -> m ()
cloneOptionsSetCheckoutBranch a
options Maybe Text
checkoutBranch = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
CString
maybeCheckoutBranch <- case Maybe Text
checkoutBranch of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jCheckoutBranch -> do
CString
jCheckoutBranch' <- Text -> IO CString
textToCString Text
jCheckoutBranch
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jCheckoutBranch'
Ptr CloneOptions -> CString -> IO ()
ggit_clone_options_set_checkout_branch Ptr CloneOptions
options' CString
maybeCheckoutBranch
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeCheckoutBranch
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CloneOptionsSetCheckoutBranchMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsSetCheckoutBranchMethodInfo a signature where
overloadedMethod = cloneOptionsSetCheckoutBranch
instance O.OverloadedMethodInfo CloneOptionsSetCheckoutBranchMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsSetCheckoutBranch",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsSetCheckoutBranch"
}
#endif
foreign import ccall "ggit_clone_options_set_fetch_options" ggit_clone_options_set_fetch_options ::
Ptr CloneOptions ->
Ptr Ggit.FetchOptions.FetchOptions ->
IO ()
cloneOptionsSetFetchOptions ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Maybe (Ggit.FetchOptions.FetchOptions)
-> m ()
cloneOptionsSetFetchOptions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> Maybe FetchOptions -> m ()
cloneOptionsSetFetchOptions a
options Maybe FetchOptions
fetchOptions = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
Ptr FetchOptions
maybeFetchOptions <- case Maybe FetchOptions
fetchOptions of
Maybe FetchOptions
Nothing -> Ptr FetchOptions -> IO (Ptr FetchOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FetchOptions
forall a. Ptr a
nullPtr
Just FetchOptions
jFetchOptions -> do
Ptr FetchOptions
jFetchOptions' <- FetchOptions -> IO (Ptr FetchOptions)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FetchOptions
jFetchOptions
Ptr FetchOptions -> IO (Ptr FetchOptions)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr FetchOptions
jFetchOptions'
Ptr CloneOptions -> Ptr FetchOptions -> IO ()
ggit_clone_options_set_fetch_options Ptr CloneOptions
options' Ptr FetchOptions
maybeFetchOptions
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
Maybe FetchOptions -> (FetchOptions -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe FetchOptions
fetchOptions FetchOptions -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CloneOptionsSetFetchOptionsMethodInfo
instance (signature ~ (Maybe (Ggit.FetchOptions.FetchOptions) -> m ()), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsSetFetchOptionsMethodInfo a signature where
overloadedMethod = cloneOptionsSetFetchOptions
instance O.OverloadedMethodInfo CloneOptionsSetFetchOptionsMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsSetFetchOptions",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsSetFetchOptions"
}
#endif
foreign import ccall "ggit_clone_options_set_is_bare" ggit_clone_options_set_is_bare ::
Ptr CloneOptions ->
CInt ->
IO ()
cloneOptionsSetIsBare ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Bool
-> m ()
cloneOptionsSetIsBare :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> Bool -> m ()
cloneOptionsSetIsBare a
options Bool
bare = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
let bare' :: CInt
bare' = (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
bare
Ptr CloneOptions -> CInt -> IO ()
ggit_clone_options_set_is_bare Ptr CloneOptions
options' CInt
bare'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CloneOptionsSetIsBareMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsSetIsBareMethodInfo a signature where
overloadedMethod = cloneOptionsSetIsBare
instance O.OverloadedMethodInfo CloneOptionsSetIsBareMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsSetIsBare",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsSetIsBare"
}
#endif
foreign import ccall "ggit_clone_options_set_local" ggit_clone_options_set_local ::
Ptr CloneOptions ->
CUInt ->
IO ()
cloneOptionsSetLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsCloneOptions a) =>
a
-> Ggit.Enums.CloneLocal
-> m ()
cloneOptionsSetLocal :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCloneOptions a) =>
a -> CloneLocal -> m ()
cloneOptionsSetLocal a
options CloneLocal
local = 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 CloneOptions
options' <- a -> IO (Ptr CloneOptions)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
options
let local' :: CUInt
local' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (CloneLocal -> Int) -> CloneLocal -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CloneLocal -> Int
forall a. Enum a => a -> Int
fromEnum) CloneLocal
local
Ptr CloneOptions -> CUInt -> IO ()
ggit_clone_options_set_local Ptr CloneOptions
options' CUInt
local'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
options
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CloneOptionsSetLocalMethodInfo
instance (signature ~ (Ggit.Enums.CloneLocal -> m ()), MonadIO m, IsCloneOptions a) => O.OverloadedMethod CloneOptionsSetLocalMethodInfo a signature where
overloadedMethod = cloneOptionsSetLocal
instance O.OverloadedMethodInfo CloneOptionsSetLocalMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Ggit.Objects.CloneOptions.cloneOptionsSetLocal",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ggit-1.0.10/docs/GI-Ggit-Objects-CloneOptions.html#v:cloneOptionsSetLocal"
}
#endif