hit-0.6.3: Git operations in haskell

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unix
Safe Haskell | None
Language | Haskell98

Data.Git.Storage.Pack

Contents

- Enumerators of packs
- Helpers to process packs
- Command for the content of a pack
- turn a packed object into a

Description

Synopsis

- data PackedObjectInfo = PackedObjectInfo {
  - poiType :: ObjectType
  - poiOffset :: Word64
  - poiSize :: Word64
  - poiActualSize :: Word64
  - poiExtra :: Maybe ObjectPtr
  }
- type PackedObjectRaw = (PackedObjectInfo, ByteString)
- packEnumerate :: FilePath -> IO [Ref]
- packOpen :: FilePath -> Ref -> IO FileReader
- packClose :: FileReader -> IO ()
- packReadHeader :: FilePath -> Ref -> IO Word32
- packReadMapAtOffset :: FileReader -> Word64 -> (ByteString -> ByteString) -> IO (Maybe Object)
- packReadAtOffset :: FileReader -> Word64 -> IO (Maybe Object)
- packReadRawAtOffset :: FileReader -> Word64 -> IO PackedObjectRaw
- packEnumerateObjects :: FilePath -> Ref -> Int -> (PackedObjectRaw -> IO a) -> IO ()
- packedObjectToObject :: (PackedObjectInfo, ByteString) -> Maybe Object
- packObjectFromRaw :: (ObjectType, Maybe ObjectPtr, ByteString) -> Maybe Object

# Documentation

data PackedObjectInfo Source

Constructors

PackedObjectInfo |

Fields

poiType :: ObjectType
poiOffset :: Word64
poiSize :: Word64
poiActualSize :: Word64
poiExtra :: Maybe ObjectPtr

Instances

Eq PackedObjectInfo Source |
Show PackedObjectInfo Source |

type PackedObjectRaw = (PackedObjectInfo, ByteString) Source

# Enumerators of packs

packEnumerate :: FilePath -> IO [Ref] Source

Enumerate the pack refs available in this repository.

# Helpers to process packs

packOpen :: FilePath -> Ref -> IO FileReader Source

open a pack

packClose :: FileReader -> IO () Source

close a pack

# Command for the content of a pack

packReadHeader :: FilePath -> Ref -> IO Word32 Source

return the number of entries in this pack

packReadMapAtOffset :: FileReader -> Word64 -> (ByteString -> ByteString) -> IO (Maybe Object) Source

read an object at a specific position using a map function on the objectData

packReadAtOffset :: FileReader -> Word64 -> IO (Maybe Object) Source

read an object at a specific position

packReadRawAtOffset :: FileReader -> Word64 -> IO PackedObjectRaw Source

read a raw representation at a specific position

packEnumerateObjects :: FilePath -> Ref -> Int -> (PackedObjectRaw -> IO a) -> IO () Source

enumerate all objects in this pack and callback to f for reach raw objects

# turn a packed object into a

packedObjectToObject :: (PackedObjectInfo, ByteString) -> Maybe Object Source

packObjectFromRaw :: (ObjectType, Maybe ObjectPtr, ByteString) -> Maybe Object Source