Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Represents the line of a diff.
Synopsis
- newtype DiffLine = DiffLine (ManagedPtr DiffLine)
- noDiffLine :: Maybe DiffLine
- diffLineGetContent :: (HasCallStack, MonadIO m) => DiffLine -> m ByteString
- diffLineGetContentOffset :: (HasCallStack, MonadIO m) => DiffLine -> m Int64
- diffLineGetNewLineno :: (HasCallStack, MonadIO m) => DiffLine -> m Int32
- diffLineGetOldLineno :: (HasCallStack, MonadIO m) => DiffLine -> m Int32
- diffLineGetOrigin :: (HasCallStack, MonadIO m) => DiffLine -> m DiffLineType
- diffLineGetText :: (HasCallStack, MonadIO m) => DiffLine -> m (Maybe Text)
- diffLineRef :: (HasCallStack, MonadIO m) => DiffLine -> m (Maybe DiffLine)
- diffLineUnref :: (HasCallStack, MonadIO m) => DiffLine -> m ()
Exported types
Memory-managed wrapper type.
Instances
BoxedObject DiffLine Source # | |
Methods
getContent
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m ByteString | Returns: the content in bytes. |
Gets the content in bytes.
getContentOffset
diffLineGetContentOffset Source #
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m Int64 | Returns: the content offset. |
Gets the content offset.
getNewLineno
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m Int32 | Returns: the line's old number of lines. |
Gets the Line number in new file or -1 for deleted line.
getOldLineno
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m Int32 | Returns: the line's old line number. |
Gets the line number in old file or -1 for added line.
getOrigin
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m DiffLineType | Returns: the |
Gets the DiffLineType
value.
getText
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m (Maybe Text) | Returns: the content in utf-8 encoding or |
Get the content of the diff line as UTF-8 encoded text.
ref
Atomically increments the reference count of line
by one.
This function is MT-safe and may be called from any thread.
unref
:: (HasCallStack, MonadIO m) | |
=> DiffLine |
|
-> m () |
Atomically decrements the reference count of line
by one.
If the reference count drops to 0, line
is freed.