Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data FilePathGlob = FilePathGlob FilePathRoot FilePathGlobRel
- data FilePathRoot
- data FilePathGlobRel
- type Glob = [GlobPiece]
- data GlobPiece
- matchFileGlob :: FilePath -> FilePathGlob -> IO [FilePath]
- matchFileGlobRel :: FilePath -> FilePathGlobRel -> IO [FilePath]
- matchGlob :: Glob -> String -> Bool
- isTrivialFilePathGlob :: FilePathGlob -> Maybe FilePath
- getFilePathRootDirectory :: FilePathRoot -> FilePath -> IO FilePath
Documentation
data FilePathGlob Source #
A file path specified by globbing
Instances
data FilePathRoot Source #
FilePathRelative | |
FilePathRoot FilePath | e.g. |
FilePathHomeDir |
Instances
data FilePathGlobRel Source #
GlobDir !Glob !FilePathGlobRel | |
GlobFile !Glob | |
GlobDirTrailing | trailing dir, a glob ending in |
Instances
A piece of a globbing pattern
Instances
Structured GlobPiece Source # | |
Defined in Distribution.Client.Glob | |
Generic GlobPiece Source # | |
Show GlobPiece Source # | |
Binary GlobPiece Source # | |
Eq GlobPiece Source # | |
type Rep GlobPiece Source # | |
Defined in Distribution.Client.Glob type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Client.Glob" "cabal-install-3.10.2.1-65TuIanu7V1TeNXBEsQf0" 'False) (C1 ('MetaCons "WildCard" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Literal" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "Union" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Glob])))) |
matchFileGlob :: FilePath -> FilePathGlob -> IO [FilePath] Source #
Match a FilePathGlob
against the file system, starting from a given
root directory for relative paths. The results of relative globs are
relative to the given root. Matches for absolute globs are absolute.
matchFileGlobRel :: FilePath -> FilePathGlobRel -> IO [FilePath] Source #
Match a FilePathGlobRel
against the file system, starting from a
given root directory. The results are all relative to the given root.
isTrivialFilePathGlob :: FilePathGlob -> Maybe FilePath Source #
Check if a FilePathGlob
doesn't actually make use of any globbing and
is in fact equivalent to a non-glob FilePath
.
If it is trivial in this sense then the result is the equivalent constant
FilePath
. On the other hand if it is not trivial (so could in principle
match more than one file) then the result is Nothing
.
getFilePathRootDirectory Source #
:: FilePathRoot | |
-> FilePath | root for relative paths |
-> IO FilePath |
Get the FilePath
corresponding to a FilePathRoot
.
The FilePath
argument is required to supply the path for the
FilePathRelative
case.