Data.Git.Storage.Pack

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 #

Constructors

PackedObjectInfo |
Fields poiType :: ObjectType poiOffset :: Word64 poiSize :: Word64 poiActualSize :: Word64 poiExtra :: Maybe ObjectPtr

Instances

Eq PackedObjectInfo # |
Methods (==) :: PackedObjectInfo -> PackedObjectInfo -> Bool # (/=) :: PackedObjectInfo -> PackedObjectInfo -> Bool #
Show PackedObjectInfo # |
Methods showsPrec :: Int -> PackedObjectInfo -> ShowS # show :: PackedObjectInfo -> String # showList :: [PackedObjectInfo] -> ShowS #

type PackedObjectRaw = (PackedObjectInfo, ByteString) #

# Enumerators of packs

packEnumerate :: FilePath -> IO [Ref] #

Enumerate the pack refs available in this repository.

# Helpers to process packs

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

open a pack

packClose :: FileReader -> IO () #

close a pack

# Command for the content of a pack

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

return the number of entries in this pack

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

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

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

read an object at a specific position

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

read a raw representation at a specific position

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

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 #

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