feat add Path
This commit is contained in:
24
include/sled/filesystem/path.h
Normal file
24
include/sled/filesystem/path.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#ifndef SLED_FILESYSTEM_PATH_H
|
||||
#define SLED_FILESYSTEM_PATH_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace sled {
|
||||
class Path {
|
||||
public:
|
||||
// cwd = current working directory
|
||||
static Path Current();
|
||||
static Path Home();
|
||||
static Path TempDir();
|
||||
|
||||
Path();
|
||||
Path(const std::string &path);
|
||||
|
||||
std::string ToString() const { return path_; };
|
||||
|
||||
private:
|
||||
std::string path_;
|
||||
};
|
||||
}// namespace sled
|
||||
#endif// SLED_FILESYSTEM_PATH_H
|
||||
13
include/sled/filesystem/temporary_file.h
Normal file
13
include/sled/filesystem/temporary_file.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#ifndef SLED_FILESYSTEM_TEMPORARY_FILE_H
|
||||
#define SLED_FILESYSTEM_TEMPORARY_FILE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace sled {
|
||||
class TemporaryFile {
|
||||
TemporaryFile();
|
||||
TemporaryFile(const std::string &tmp_dir);
|
||||
};
|
||||
}// namespace sled
|
||||
#endif// SLED_FILESYSTEM_TEMPORARY_FILE_H
|
||||
Reference in New Issue
Block a user