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.PackIndex

Contents

- handles and enumeration
- read from packIndex

Description

Synopsis

- data PackIndexHeader = PackIndexHeader !Word32 !(Vector Word32)
- data PackIndex = PackIndex {
  - packIndexSha1s :: Vector Ref
  - packIndexCRCs :: Vector Word32
  - packIndexPackoffs :: Vector Word32
  - packIndexPackChecksum :: Ref
  - packIndexChecksum :: Ref
  }
- packIndexOpen :: FilePath -> Ref -> IO FileReader
- packIndexClose :: FileReader -> IO ()
- withPackIndex :: FilePath -> Ref -> (FileReader -> IO a) -> IO a
- packIndexEnumerate :: FilePath -> IO [Ref]
- packIndexHeaderGetNbWithPrefix :: PackIndexHeader -> Int -> Word32
- packIndexGetReferenceLocation :: PackIndexHeader -> FileReader -> Ref -> IO (Maybe Word64)
- packIndexGetReferencesWithPrefix :: PackIndexHeader -> FileReader -> String -> IO [Ref]
- packIndexReadHeader :: FileReader -> IO PackIndexHeader
- packIndexRead :: FilePath -> Ref -> IO (PackIndexHeader, (Vector Ref, Vector Word32, Vector Word32, [ByteString], Ref, Ref))
- packIndexGetHeader :: FilePath -> Ref -> IO PackIndexHeader

# Documentation

data PackIndexHeader #

represent an packIndex header with the version and the fanout table

Constructors

PackIndexHeader !Word32 !(Vector Word32) |

Instances

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

data PackIndex #

Constructors

PackIndex |
Fields packIndexSha1s :: Vector Ref packIndexCRCs :: Vector Word32 packIndexPackoffs :: Vector Word32 packIndexPackChecksum :: Ref packIndexChecksum :: Ref

# handles and enumeration

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

open an index

packIndexClose :: FileReader -> IO () #

close an index

withPackIndex :: FilePath -> Ref -> (FileReader -> IO a) -> IO a #

variant of withFile on the index file and with a FileReader

packIndexEnumerate :: FilePath -> IO [Ref] #

enumerate every indexes file in the pack directory

# read from packIndex

packIndexHeaderGetNbWithPrefix :: PackIndexHeader -> Int -> Word32 #

get the number of reference in this index with a specific prefix

packIndexGetReferenceLocation :: PackIndexHeader -> FileReader -> Ref -> IO (Maybe Word64) #

return the reference offset in the packfile if found

packIndexGetReferencesWithPrefix :: PackIndexHeader -> FileReader -> String -> IO [Ref] #

get all references that start by prefix.

packIndexReadHeader :: FileReader -> IO PackIndexHeader #

read index header from an index filereader

packIndexRead :: FilePath -> Ref -> IO (PackIndexHeader, (Vector Ref, Vector Word32, Vector Word32, [ByteString], Ref, Ref)) #

read all index

packIndexGetHeader :: FilePath -> Ref -> IO PackIndexHeader #

get index header from an index reference