module GI.Ggit.Objects.Commit
(
Commit(..) ,
IsCommit ,
toCommit ,
noCommit ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitAmendMethodInfo ,
#endif
commitAmend ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetAuthorMethodInfo ,
#endif
commitGetAuthor ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetCommitterMethodInfo ,
#endif
commitGetCommitter ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetMessageMethodInfo ,
#endif
commitGetMessage ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetMessageEncodingMethodInfo ,
#endif
commitGetMessageEncoding ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetNthAncestorMethodInfo ,
#endif
commitGetNthAncestor ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetParentsMethodInfo ,
#endif
commitGetParents ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetSubjectMethodInfo ,
#endif
commitGetSubject ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetTreeMethodInfo ,
#endif
commitGetTree ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
CommitGetTreeIdMethodInfo ,
#endif
commitGetTreeId ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Ggit.Objects.CommitParents as Ggit.CommitParents
import qualified GI.Ggit.Objects.Native as Ggit.Native
import qualified GI.Ggit.Objects.Object as Ggit.Object
import qualified GI.Ggit.Objects.ObjectFactoryBase as Ggit.ObjectFactoryBase
import qualified GI.Ggit.Objects.Signature as Ggit.Signature
import qualified GI.Ggit.Objects.Tree as Ggit.Tree
import qualified GI.Ggit.Structs.OId as Ggit.OId
newtype Commit = Commit (ManagedPtr Commit)
foreign import ccall "ggit_commit_get_type"
c_ggit_commit_get_type :: IO GType
instance GObject Commit where
gobjectType _ = c_ggit_commit_get_type
class GObject o => IsCommit o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError Commit a) =>
IsCommit a
#endif
instance IsCommit Commit
instance Ggit.Object.IsObject Commit
instance Ggit.Native.IsNative Commit
instance Ggit.ObjectFactoryBase.IsObjectFactoryBase Commit
instance GObject.Object.IsObject Commit
toCommit :: (MonadIO m, IsCommit o) => o -> m Commit
toCommit = liftIO . unsafeCastTo Commit
noCommit :: Maybe Commit
noCommit = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveCommitMethod (t :: Symbol) (o :: *) :: * where
ResolveCommitMethod "amend" o = CommitAmendMethodInfo
ResolveCommitMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCommitMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCommitMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCommitMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCommitMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCommitMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCommitMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCommitMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCommitMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCommitMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveCommitMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveCommitMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCommitMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCommitMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCommitMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCommitMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCommitMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCommitMethod "getAuthor" o = CommitGetAuthorMethodInfo
ResolveCommitMethod "getCommitter" o = CommitGetCommitterMethodInfo
ResolveCommitMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCommitMethod "getId" o = Ggit.Object.ObjectGetIdMethodInfo
ResolveCommitMethod "getMessage" o = CommitGetMessageMethodInfo
ResolveCommitMethod "getMessageEncoding" o = CommitGetMessageEncodingMethodInfo
ResolveCommitMethod "getNthAncestor" o = CommitGetNthAncestorMethodInfo
ResolveCommitMethod "getOwner" o = Ggit.Object.ObjectGetOwnerMethodInfo
ResolveCommitMethod "getParents" o = CommitGetParentsMethodInfo
ResolveCommitMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCommitMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCommitMethod "getSubject" o = CommitGetSubjectMethodInfo
ResolveCommitMethod "getTree" o = CommitGetTreeMethodInfo
ResolveCommitMethod "getTreeId" o = CommitGetTreeIdMethodInfo
ResolveCommitMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCommitMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCommitMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCommitMethod t Commit, O.MethodInfo info Commit p) => O.IsLabelProxy t (Commit -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveCommitMethod t Commit, O.MethodInfo info Commit p) => O.IsLabel t (Commit -> 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
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Commit
type instance O.AttributeList Commit = CommitAttributeList
type CommitAttributeList = ('[ '("native", Ggit.Native.NativeNativePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList Commit = CommitSignalList
type CommitSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "ggit_commit_amend" ggit_commit_amend ::
Ptr Commit ->
CString ->
Ptr Ggit.Signature.Signature ->
Ptr Ggit.Signature.Signature ->
CString ->
CString ->
Ptr Ggit.Tree.Tree ->
Ptr (Ptr GError) ->
IO (Ptr Ggit.OId.OId)
commitAmend ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c, Ggit.Tree.IsTree d) =>
a
-> Maybe (T.Text)
-> b
-> c
-> Maybe (T.Text)
-> T.Text
-> d
-> m Ggit.OId.OId
commitAmend commit updateRef author committer messageEncoding message tree = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
maybeUpdateRef <- case updateRef of
Nothing -> return nullPtr
Just jUpdateRef -> do
jUpdateRef' <- textToCString jUpdateRef
return jUpdateRef'
author' <- unsafeManagedPtrCastPtr author
committer' <- unsafeManagedPtrCastPtr committer
maybeMessageEncoding <- case messageEncoding of
Nothing -> return nullPtr
Just jMessageEncoding -> do
jMessageEncoding' <- textToCString jMessageEncoding
return jMessageEncoding'
message' <- textToCString message
tree' <- unsafeManagedPtrCastPtr tree
onException (do
result <- propagateGError $ ggit_commit_amend commit' maybeUpdateRef author' committer' maybeMessageEncoding message' tree'
checkUnexpectedReturnNULL "commitAmend" result
result' <- (wrapBoxed Ggit.OId.OId) result
touchManagedPtr commit
touchManagedPtr author
touchManagedPtr committer
touchManagedPtr tree
freeMem maybeUpdateRef
freeMem maybeMessageEncoding
freeMem message'
return result'
) (do
freeMem maybeUpdateRef
freeMem maybeMessageEncoding
freeMem message'
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitAmendMethodInfo
instance (signature ~ (Maybe (T.Text) -> b -> c -> Maybe (T.Text) -> T.Text -> d -> m Ggit.OId.OId), MonadIO m, IsCommit a, Ggit.Signature.IsSignature b, Ggit.Signature.IsSignature c, Ggit.Tree.IsTree d) => O.MethodInfo CommitAmendMethodInfo a signature where
overloadedMethod _ = commitAmend
#endif
foreign import ccall "ggit_commit_get_author" ggit_commit_get_author ::
Ptr Commit ->
IO (Ptr Ggit.Signature.Signature)
commitGetAuthor ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m Ggit.Signature.Signature
commitGetAuthor commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_author commit'
checkUnexpectedReturnNULL "commitGetAuthor" result
result' <- (wrapObject Ggit.Signature.Signature) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetAuthorMethodInfo
instance (signature ~ (m Ggit.Signature.Signature), MonadIO m, IsCommit a) => O.MethodInfo CommitGetAuthorMethodInfo a signature where
overloadedMethod _ = commitGetAuthor
#endif
foreign import ccall "ggit_commit_get_committer" ggit_commit_get_committer ::
Ptr Commit ->
IO (Ptr Ggit.Signature.Signature)
commitGetCommitter ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m Ggit.Signature.Signature
commitGetCommitter commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_committer commit'
checkUnexpectedReturnNULL "commitGetCommitter" result
result' <- (wrapObject Ggit.Signature.Signature) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetCommitterMethodInfo
instance (signature ~ (m Ggit.Signature.Signature), MonadIO m, IsCommit a) => O.MethodInfo CommitGetCommitterMethodInfo a signature where
overloadedMethod _ = commitGetCommitter
#endif
foreign import ccall "ggit_commit_get_message" ggit_commit_get_message ::
Ptr Commit ->
IO CString
commitGetMessage ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m T.Text
commitGetMessage commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_message commit'
checkUnexpectedReturnNULL "commitGetMessage" result
result' <- cstringToText result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetMessageMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCommit a) => O.MethodInfo CommitGetMessageMethodInfo a signature where
overloadedMethod _ = commitGetMessage
#endif
foreign import ccall "ggit_commit_get_message_encoding" ggit_commit_get_message_encoding ::
Ptr Commit ->
IO CString
commitGetMessageEncoding ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m T.Text
commitGetMessageEncoding commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_message_encoding commit'
checkUnexpectedReturnNULL "commitGetMessageEncoding" result
result' <- cstringToText result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetMessageEncodingMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCommit a) => O.MethodInfo CommitGetMessageEncodingMethodInfo a signature where
overloadedMethod _ = commitGetMessageEncoding
#endif
foreign import ccall "ggit_commit_get_nth_ancestor" ggit_commit_get_nth_ancestor ::
Ptr Commit ->
Word32 ->
Ptr (Ptr GError) ->
IO (Ptr Commit)
commitGetNthAncestor ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> Word32
-> m Commit
commitGetNthAncestor commit n = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
onException (do
result <- propagateGError $ ggit_commit_get_nth_ancestor commit' n
checkUnexpectedReturnNULL "commitGetNthAncestor" result
result' <- (wrapObject Commit) result
touchManagedPtr commit
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetNthAncestorMethodInfo
instance (signature ~ (Word32 -> m Commit), MonadIO m, IsCommit a) => O.MethodInfo CommitGetNthAncestorMethodInfo a signature where
overloadedMethod _ = commitGetNthAncestor
#endif
foreign import ccall "ggit_commit_get_parents" ggit_commit_get_parents ::
Ptr Commit ->
IO (Ptr Ggit.CommitParents.CommitParents)
commitGetParents ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m Ggit.CommitParents.CommitParents
commitGetParents commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_parents commit'
checkUnexpectedReturnNULL "commitGetParents" result
result' <- (wrapObject Ggit.CommitParents.CommitParents) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetParentsMethodInfo
instance (signature ~ (m Ggit.CommitParents.CommitParents), MonadIO m, IsCommit a) => O.MethodInfo CommitGetParentsMethodInfo a signature where
overloadedMethod _ = commitGetParents
#endif
foreign import ccall "ggit_commit_get_subject" ggit_commit_get_subject ::
Ptr Commit ->
IO CString
commitGetSubject ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m T.Text
commitGetSubject commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_subject commit'
checkUnexpectedReturnNULL "commitGetSubject" result
result' <- cstringToText result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetSubjectMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCommit a) => O.MethodInfo CommitGetSubjectMethodInfo a signature where
overloadedMethod _ = commitGetSubject
#endif
foreign import ccall "ggit_commit_get_tree" ggit_commit_get_tree ::
Ptr Commit ->
IO (Ptr Ggit.Tree.Tree)
commitGetTree ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m Ggit.Tree.Tree
commitGetTree commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_tree commit'
checkUnexpectedReturnNULL "commitGetTree" result
result' <- (wrapObject Ggit.Tree.Tree) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetTreeMethodInfo
instance (signature ~ (m Ggit.Tree.Tree), MonadIO m, IsCommit a) => O.MethodInfo CommitGetTreeMethodInfo a signature where
overloadedMethod _ = commitGetTree
#endif
foreign import ccall "ggit_commit_get_tree_id" ggit_commit_get_tree_id ::
Ptr Commit ->
IO (Ptr Ggit.OId.OId)
commitGetTreeId ::
(B.CallStack.HasCallStack, MonadIO m, IsCommit a) =>
a
-> m Ggit.OId.OId
commitGetTreeId commit = liftIO $ do
commit' <- unsafeManagedPtrCastPtr commit
result <- ggit_commit_get_tree_id commit'
checkUnexpectedReturnNULL "commitGetTreeId" result
result' <- (wrapBoxed Ggit.OId.OId) result
touchManagedPtr commit
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data CommitGetTreeIdMethodInfo
instance (signature ~ (m Ggit.OId.OId), MonadIO m, IsCommit a) => O.MethodInfo CommitGetTreeIdMethodInfo a signature where
overloadedMethod _ = commitGetTreeId
#endif