zorba::fs

Enumerations

type

File type.

Type Definitions

os_error::exception

exception

off_t

size_type

File size type.

Variables

char const

dir_separator

char const

newline[]

char const

path_separator

Functions

std::enable_if< ZORBA_IS_STRING(PathStringType1), void >::type

append(PathStringType1 &path1, char const *path2)

Appends a path component onto another path ensuring that exactly one separator is used.

std::enable_if< ZORBA_IS_STRING(PathStringType1)&&ZORBA_HAS_C_STR(PathStringType2), void >::type

append(PathStringType1 &path1, PathStringType2 const &path2)

Appends a path component onto another path.

char const *

base_name(char const *path)

Gets the base name of the given path name, i.e., the file name without the path leading up to it.

std::enable_if< ZORBA_IS_STRING(PathStringType), PathStringType >::type

base_name(PathStringType const &path)

Gets the base name of the given path name, i.e., the file name without the path leading up to it.

ZORBA_DLL_PUBLIC std::string

curdir()

Gets the current directory.

std::string

dir_name(char const *path)

Gets the directory name of the given path name, i.e., the path up to but not including the last path component.

std::enable_if< ZORBA_IS_STRING(PathStringType), PathStringType >::type

dir_name(PathStringType const &path)

Gets the directory name of the given path name, i.e., the path up to but not including the last path component.

bool

is_absolute(char const *path)

Checks whether the given path is an absolute path.

std::enable_if< ZORBA_HAS_C_STR(PathStringType), bool >::type

is_absolute(PathStringType const &path)

Checks whether the given path is an absolute path.

std::enable_if< ZORBA_IS_STRING(PathStringType), void >::type

make_absolute(PathStringType *path)

Makes a relative path into an absolute path.

ZORBA_DLL_PUBLIC std::string

normalize_path(char const *path, char const *base=nullptr)

Gets the normalized path of the given path.

std::enable_if< ZORBA_HAS_C_STR(PathStringType), std::string >::type

normalize_path(PathStringType const &path)

Gets the normalized path of the given path.

std::enable_if< ZORBA_HAS_C_STR(PathStringType)&&ZORBA_HAS_C_STR(BaseStringType), std::string >::type

normalize_path(PathStringType const &path, BaseStringType const &base)

Gets the normalized path of the given path.

ZORBA_DLL_PUBLIC std::ostream &

operator<<(std::ostream &o, type t)

Emits the string representation of a file type to the given ostream.

Enumerations

type

 type

File type.

Type Definitions

exception

size_type

off_t size_type

File size type.

Variables

dir_separator

char const dir_separator

newline

char const newline[]

path_separator

char const path_separator

Functions

append

std::enable_if< ZORBA_IS_STRING(PathStringType1), void >::type append(PathStringType1 &path1, char const *path2)

Appends a path component onto another path ensuring that exactly one separator is used.

Parameters

PathStringType1 The path1 string type.

Parameters

path1 The path to append to.
path2 The path to append.

append

std::enable_if< ZORBA_IS_STRING(PathStringType1)&&ZORBA_HAS_C_STR(PathStringType2), void >::type append(PathStringType1 &path1, PathStringType2 const &path2)

Appends a path component onto another path.

Parameters

PathStringType1 The path1 string type.
PathStringType2 The path2 string type.

Parameters

path1 The path to append to.
path2 The path to append.

base_name

char const * base_name(char const *path)

Gets the base name of the given path name, i.e., the file name without the path leading up to it.

Parameters

path The full path to get the base name of.

Returns

Returns the base name. Note that if path is just a file name, then returns path.

base_name

std::enable_if< ZORBA_IS_STRING(PathStringType), PathStringType >::type base_name(PathStringType const &path)

Gets the base name of the given path name, i.e., the file name without the path leading up to it.

Parameters

PathStringType The path string type.

Parameters

path The full path to get the base name of.

Returns

Returns the base name. If path is just a file name, returns path.

curdir

ZORBA_DLL_PUBLIC std::string curdir()

Gets the current directory.

Returns

Returns said directory.

Parameters

with a diagnostic of zerr::ZOSE0004_IO_ERROR if it fails.

dir_name

std::string dir_name(char const *path)

Gets the directory name of the given path name, i.e., the path up to but not including the last path component.

Parameters

path The path to get the directory name of.

Returns

Returns the direcory path. If path is just a file name, returns '.'.

dir_name

std::enable_if< ZORBA_IS_STRING(PathStringType), PathStringType >::type dir_name(PathStringType const &path)

Gets the directory name of the given path name, i.e., the path up to but not including the last path component.

Parameters

PathStringType The path string type.

Parameters

path The path to get the directory name of.

Returns

Returns the direcory path. If path is just a file name, returns '.'.

is_absolute

bool is_absolute(char const *path)

Checks whether the given path is an absolute path.

Parameters

path The full path to check.

Returns

Returns true only if the path is absolute.

is_absolute

std::enable_if< ZORBA_HAS_C_STR(PathStringType), bool >::type is_absolute(PathStringType const &path)

Checks whether the given path is an absolute path.

Parameters

PathStringType The path string type.

Parameters

path The full path to check.

Returns

Returns true only if the path is absolute.

make_absolute

std::enable_if< ZORBA_IS_STRING(PathStringType), void >::type make_absolute(PathStringType *path)

Makes a relative path into an absolute path.

Parameters

PathStringType The path string type.

Parameters

path A pointer to the path to make absolute.

normalize_path

ZORBA_DLL_PUBLIC std::string normalize_path(char const *path, char const *base=nullptr)

Gets the normalized path of the given path.

A normalized path is one that:

  • has URIs converted to paths
  • has directory separators corrected for the host operating system
  • has adjacent directory separators combined, e.g., /a//b becomes /a/b
  • has ./ removed, e.g., /a/./b becomes /a/b
  • has ../ removed, e.g., /a/b/../c becomes /a/c

Parameters

path The path to normalize.
base The base path. If not empty, is prepended to path.

Returns

Returns the normalized path.

Parameters

std::invalid_argument for malformed paths.

normalize_path

std::enable_if< ZORBA_HAS_C_STR(PathStringType), std::string >::type normalize_path(PathStringType const &path)

Gets the normalized path of the given path.

A normalized path is one that:

  • has URIs converted to paths
  • has directory separators corrected for the host operating system
  • has adjacent directory separators combined, e.g., /a//b becomes /a/b
  • has ./ removed, e.g., /a/./b becomes /a/b
  • has ../ removed, e.g., /a/b/../c becomes /a/c

Parameters

PathStringType The path string type.

Parameters

path The path to normalize.

Returns

Returns the normalized path.

Parameters

std::invalid_argument for malformed paths.

normalize_path

std::enable_if< ZORBA_HAS_C_STR(PathStringType)&&ZORBA_HAS_C_STR(BaseStringType), std::string >::type normalize_path(PathStringType const &path, BaseStringType const &base)

Gets the normalized path of the given path.

A normalized path is one that:

  • has URIs converted to paths
  • has directory separators corrected for the host operating system
  • has adjacent directory separators combined, e.g., /a//b becomes /a/b
  • has ./ removed, e.g., /a/./b becomes /a/b
  • has ../ removed, e.g., /a/b/../c becomes /a/c

Parameters

PathStringType The path string type.
BaseStringType The base string type.

Parameters

path The path to normalize.
base The base path. If not empty, is prepended to path.

Returns

Returns the normalized path.

Parameters

std::invalid_argument for malformed paths.

operator<<

ZORBA_DLL_PUBLIC std::ostream & operator<<(std::ostream &o, type t)

Emits the string representation of a file type to the given ostream.

Parameters

o The ostream to emit to.
t The file type to emit.

Returns

Returns o.