| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Distribution.Client.Glob
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
Constructors
| FilePathGlob FilePathRoot FilePathGlobRel |
Instances
data FilePathRoot Source #
Constructors
| FilePathRelative | |
| FilePathRoot FilePath | e.g. |
| FilePathHomeDir |
Instances
data FilePathGlobRel Source #
Constructors
| GlobDir !Glob !FilePathGlobRel | |
| GlobFile !Glob | |
| GlobDirTrailing | trailing dir, a glob ending in |
Instances
A piece of a globbing pattern
Instances
| Eq GlobPiece Source # | |
| Show GlobPiece Source # | |
| Generic GlobPiece Source # | |
| Binary GlobPiece Source # | |
| Structured GlobPiece Source # | |
Defined in Distribution.Client.Glob | |
| type Rep GlobPiece Source # | |
Defined in Distribution.Client.Glob type Rep GlobPiece = D1 ('MetaData "GlobPiece" "Distribution.Client.Glob" "cabal-install-3.8.1.0-7iNu5HGLMqL9QLfLAUJqbd" '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 #
Arguments
| :: 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.