diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/System/Torrent/Storage.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/System/Torrent/Storage.hs b/src/System/Torrent/Storage.hs index bb6c5d2e..fafdab98 100644 --- a/src/System/Torrent/Storage.hs +++ b/src/System/Torrent/Storage.hs | |||
@@ -23,6 +23,10 @@ module System.Torrent.Storage | |||
23 | , open | 23 | , open |
24 | , close | 24 | , close |
25 | 25 | ||
26 | -- * Query | ||
27 | , genPieceInfo | ||
28 | , getBitfield | ||
29 | |||
26 | -- * Modification | 30 | -- * Modification |
27 | , writePiece | 31 | , writePiece |
28 | , readPiece | 32 | , readPiece |
@@ -32,6 +36,7 @@ module System.Torrent.Storage | |||
32 | import Control.Applicative | 36 | import Control.Applicative |
33 | import Data.ByteString.Lazy as BL | 37 | import Data.ByteString.Lazy as BL |
34 | 38 | ||
39 | import Data.Torrent.Bitfield | ||
35 | import Data.Torrent.Layout | 40 | import Data.Torrent.Layout |
36 | import Data.Torrent.Piece | 41 | import Data.Torrent.Piece |
37 | import System.Torrent.FileMap | 42 | import System.Torrent.FileMap |
@@ -65,3 +70,11 @@ unsafeReadPiece pix Storage {..} = return $ Piece pix lbs | |||
65 | where | 70 | where |
66 | lbs = unsafeReadBytes (fromIntegral (pix * pieceLen)) | 71 | lbs = unsafeReadBytes (fromIntegral (pix * pieceLen)) |
67 | (fromIntegral pieceLen) fileMap | 72 | (fromIntegral pieceLen) fileMap |
73 | |||
74 | -- | TODO examples of use | ||
75 | genPieceInfo :: Storage -> IO PieceInfo | ||
76 | genPieceInfo = undefined | ||
77 | |||
78 | -- | TODO examples of use | ||
79 | getBitfield :: Storage -> PieceInfo -> IO Bitfield | ||
80 | getBitfield = undefined \ No newline at end of file | ||