Module FilePath


module FilePath: sig .. end
Module to manipulate abstract filename ( doesn't need to be real path ).


Module to manipulate abstract filename ( doesn't need to be real path ).

Exceptions


exception FilePathBaseFilenameRelative
You cannot pass a base filename which is relative
exception FilePathRelativeUnreducable
One of the filename passed is relative and cannot be reduce
exception FilePathUnrecognizedOS of string
We do not have recognized any OS, please contact upstream
exception FilePathFilenameMultiple
An expansion of filename_part_of_filename generate more than one component
exception FilePathEmpty
The filename use was empty
exception FilePathNoExtension
The last component of the filename does not support extension ( Root, ParentDir... )
exception FilePathInvalidFilename
The filename used is invalid

Filename utility specification


module type OS_SPECIFICATION = sig .. end
Signature needed to create a new filesystem...
module type PATH_SPECIFICATION = sig .. end
Generic operation on filename
module type PATH_STRING_SPECIFICATION = PATH_SPECIFICATION  with type filename = string
Generic operation on filename, the type filename being a string
module type META_PATH_SPECIFICATION = functor (OsOperation : OS_SPECIFICATION) -> PATH_SPECIFICATION
Meta structure to generate a module for a new filesystem specification.
module type META_PATH_STRING_SPECIFICATION = functor (PathOperation : PATH_SPECIFICATION) -> PATH_STRING_SPECIFICATION
Meta structure to define a string-proxy doing the conversion between an abstract type to a string type
module GenericPath: 
functor (OsOperation : OS_SPECIFICATION) -> sig .. end
Implementation of the META_PATH_SPECIFICATION
module GenericStringPath: 
functor (PathOperation : PATH_SPECIFICATION) -> sig .. end
Implementation of the META_PATH_STRING_SPECIFICATION

Instanciation of specific OS filename



Some instanciation of the above structure. You can use it to manipulate filename However, this function is mainly for testing purpose. You should consider using DefaultPath which is the binding for the current running OS. If you need to manipulate frequently filename, for storing them in a Set, doing frequent operation... You should consider using an abstract type. Otherwise, you should consider using the normal one, which enables you to simply manipulate string ( type filename = string, so all operation can be made using string
module AbstractDefaultPath: GenericPath(sig
val os_depend : 'a -> 'a -> 'a -> 'a -> 'a
val dir_writer : FilePath_type.filename_part list -> string
val dir_reader : Lexing.lexbuf -> FilePath_type.filename_part list
val path_writer : string list -> string
val path_reader : Lexing.lexbuf -> FilePath_type.filename list
end)
module DefaultPath: GenericStringPath(AbstractDefaultPath)
module AbstractUnixPath: GenericPath(sig
val dir_writer : FilePath_type.filename_part list -> string
val dir_reader : Lexing.lexbuf -> FilePath_type.filename_part list
val path_writer : string list -> string
val path_reader : Lexing.lexbuf -> FilePath_type.filename list
end)
module UnixPath: GenericStringPath(AbstractUnixPath)
module AbstractMacOSPath: GenericPath(sig
val dir_writer : FilePath_type.filename_part list -> string
val dir_reader : Lexing.lexbuf -> FilePath_type.filename_part list
val path_writer : string list -> string
val path_reader : Lexing.lexbuf -> FilePath_type.filename list
end)
module MacOSPath: GenericStringPath(AbstractMacOSPath)
module AbstractWin32Path: GenericPath(sig
val dir_writer : FilePath_type.filename_part list -> string
val dir_reader : Lexing.lexbuf -> FilePath_type.filename_part list
val path_writer : string list -> string
val path_reader : Lexing.lexbuf -> FilePath_type.filename list
end)
module Win32Path: GenericStringPath(AbstractWin32Path)
module AbstractCygwinPath: GenericPath(sig
val dir_writer : FilePath_type.filename_part list -> string
val dir_reader : Lexing.lexbuf -> FilePath_type.filename_part list
val path_writer : string list -> string
val path_reader : Lexing.lexbuf -> FilePath_type.filename list
end)
module CygwinPath: GenericStringPath(AbstractCygwinPath)