bittorrent-0.0.0.3: Bittorrent protocol implementation.

Portabilityportable
Stabilityexperimental
Maintainerpxqr.sta@gmail.com
Safe HaskellNone

Data.Torrent.Tree

Contents

Description

Directory tree can be used to easily manipulate file layout info.

Synopsis

Directory tree

data DirTree a Source

DirTree is more convenient form of LayoutInfo.

Constructors

Dir 
File 

Fields

node :: FileInfo a
 

Instances

Show a => Show (DirTree a) 

Construction

build :: LayoutInfo -> DirTree ()Source

Build directory tree from a list of files.

Query

lookup :: [FilePath] -> DirTree a -> Maybe (DirTree a)Source

Lookup file by path.

lookupDir :: [FilePath] -> DirTree a -> Maybe [(BS.ByteString, DirTree a)]Source

Lookup directory by path.

fileNumber :: DirTree a -> Sum IntSource

Get total count of files in directory and subdirectories.

dirNumber :: DirTree a -> Sum IntSource

Get total count of directories in the directory and subdirectories.