diff --git a/src/lib/include/jes/Path.h b/src/lib/include/jes/Path.h new file mode 100644 index 0000000..a20aa78 --- /dev/null +++ b/src/lib/include/jes/Path.h @@ -0,0 +1,21 @@ +#ifndef JES_PATH_H +#define JES_PATH_H + +#include + +namespace jes +{ + class Path + { + public: + Path(const char * path); + Path(const std::string & path); + Path dirname(); + Path join(const Path & other); + protected: + void clean(); + std::string m_path; + }; +} + +#endif diff --git a/src/lib/src/Path.cc b/src/lib/src/Path.cc new file mode 100644 index 0000000..295d06b --- /dev/null +++ b/src/lib/src/Path.cc @@ -0,0 +1,37 @@ +#include "jes/Path.h" + +namespace jes +{ + Path::Path(const char * path) + { + m_path = path; + clean(); + } + + Path::Path(const std::string & path) + { + m_path = path; + clean(); + } + + Path Path::dirname() + { + // TODO + return ""; + } + + Path Path::join(const Path & other) + { + // TODO + return ""; + } + + void Path::clean() + { + for (char & c : m_path) + { + if (c == '\\') + c = '/'; + } + } +}