darcs-beta-2.4.98.5: a distributed, interactive, smart revision control systemSource codeContentsIndex
Darcs.Patch.FileName
Description
FileName is an abstract type intended to facilitate the input and output of unicode filenames.
Synopsis
data FileName
fp2fn :: FilePath -> FileName
fn2fp :: FileName -> FilePath
fn2ps :: FileName -> ByteString
ps2fn :: ByteString -> FileName
niceps2fn :: ByteString -> FileName
fn2niceps :: FileName -> ByteString
breakOnDir :: FileName -> Maybe (FileName, FileName)
normPath :: FileName -> FileName
ownName :: FileName -> FileName
superName :: FileName -> FileName
movedirfilename :: FileName -> FileName -> FileName -> FileName
encodeWhite :: FilePath -> String
decodeWhite :: String -> FilePath
(///) :: FileName -> FileName -> FileName
breakup :: String -> [String]
Documentation
data FileName Source
show/hide Instances
fp2fn :: FilePath -> FileNameSource
fn2fp :: FileName -> FilePathSource
fn2ps :: FileName -> ByteStringSource
ps2fn :: ByteString -> FileNameSource
niceps2fn :: ByteString -> FileNameSource
fn2niceps :: FileName -> ByteStringSource
breakOnDir :: FileName -> Maybe (FileName, FileName)Source
normPath :: FileName -> FileNameSource
ownName :: FileName -> FileNameSource
superName :: FileName -> FileNameSource
movedirfilename :: FileName -> FileName -> FileName -> FileNameSource
encodeWhite :: FilePath -> StringSource

encodeWhite translates whitespace in filenames to a darcs-specific format (numerical representation according to ord surrounded by backslashes). Note that backslashes are also escaped since they are used in the encoding.

 encodeWhite "hello there" == "hello\32\there"
 encodeWhite "hello\there" == "hello\92\there"
decodeWhite :: String -> FilePathSource

decodeWhite interprets the Darcs-specific "encoded" filenames produced by encodeWhite

 decodeWhite "hello\32\there"  == "hello there"
 decodeWhite "hello\92\there"  == "hello\there"
 decodeWhite "hello\there"   == error "malformed filename"
(///) :: FileName -> FileName -> FileNameSource
breakup :: String -> [String]Source
Split a file path at the slashes
Produced by Haddock version 2.6.1