8 #ifndef META_OCEAN_IO_PATH_H
9 #define META_OCEAN_IO_PATH_H
55 SEPARATOR_UNDEFINED = 0,
57 SEPARATOR_SLASH =
'/',
59 SEPARATOR_BACKSLASH =
'\\'
73 inline Type type()
const;
80 inline bool isAbsolute()
const;
87 inline bool isRelative()
const;
99 inline bool isNull()
const;
119 inline bool operator!=(
const Path& path)
const;
125 inline const std::string& operator()()
const;
131 inline bool operator<(
const Path& path)
const;
163 explicit Path(
const std::string& value);
213 return !(*
this == path);
223 return (*
this)() < path();
This class holds a path.
Definition: Path.h:27
bool operator==(const Path &right) const
Returns whether two paths are equal.
void trim()
Trims this path.
bool isRelative() const
Returns whether this path is relative.
Definition: Path.h:201
virtual bool isValid() const =0
Returns whether the path is valid.
void checkPath(const Type expectType)
Checks the type of this path and trims it.
Type
Definition of different path types.
Definition: Path.h:34
@ TYPE_RELATIVE
Relative path.
Definition: Path.h:44
@ TYPE_ABSOLUTE
Absolute path.
Definition: Path.h:42
Path & operator=(const Path &path)=default
Default assign operator.
std::string pathValue_
Path value.
Definition: Path.h:188
bool isNull() const
Returns whether this path holds no valid.
Definition: Path.h:206
bool operator!=(const Path &path) const
Returns whether two paths are not equal.
Definition: Path.h:211
Type pathType_
Path type.
Definition: Path.h:185
static char defaultSeparator()
Returns the default separator of a path.
bool operator<(const Path &path) const
Less operator comparing the actual strings of two paths.
Definition: Path.h:221
virtual ~Path()=default
Destructs a path.
Path(const Path &path)=default
Copy constructor.
const std::string & operator()() const
Returns the value of this path.
Definition: Path.h:216
Separator
Definition of path separators.
Definition: Path.h:53
virtual bool exists() const =0
Returns whether the path exists already.
static bool isSeparator(const char character)
Returns whether a given character is a separator.
Path(const std::string &value)
Creates a new path.
Path()=default
Creates a new undefined path.
Type type() const
Returns the type of this path.
Definition: Path.h:191
bool isAbsolute() const
Returns whether this path is absolute.
Definition: Path.h:196
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15