feat add Path

This commit is contained in:
tqcq
2024-03-03 12:30:15 +08:00
parent abc1a88bd0
commit 333281ec06
4 changed files with 86 additions and 1 deletions

View 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

View 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