add initial Path class
This commit is contained in:
parent
83553e78f1
commit
28b05da01c
21
src/lib/include/jes/Path.h
Normal file
21
src/lib/include/jes/Path.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef JES_PATH_H
|
||||
#define JES_PATH_H
|
||||
|
||||
#include <string>
|
||||
|
||||
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
|
37
src/lib/src/Path.cc
Normal file
37
src/lib/src/Path.cc
Normal file
@ -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 = '/';
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user