10 :
std::filesystem::path(path_)
19 for (
int iloop=0; iloop<1000; iloop++)
21 std::filesystem::path proj = std::filesystem::current_path();
22 std::ostringstream oss;
23 oss <<
"hal_proj" << (1000 + rand() % 9000);
24 proj.append(oss.str());
25 if (!std::filesystem::exists(proj))
33 if (empty())
return std::filesystem::path();
34 if (!std::filesystem::exists(*
this))
return std::filesystem::path();
35 return std::filesystem::canonical(*
this);
40 std::string
name(filename());
41 name += extension.empty() ? std::string(
".hal") : extension;
49 std::filesystem::path rel(relative_filename);
51 if (rel.is_relative())
52 retval.append(relative_filename);
54 retval.append(rel.filename().string());
60 std::string
name(filename());
61 name += extension.empty() ? std::string(
".hal") : extension;
76 std::filesystem::path retval(filename);
77 if (retval.is_relative() || filename.empty() || empty())
return retval;
78 std::string relative = filename;
80 int n = canonical_dir.size();
81 if (!relative.compare(0,
n,canonical_dir))
82 return (std::filesystem::path(relative.substr(
n)));
std::filesystem::path get_filename(const std::string &relative_filename) const
std::filesystem::path get_relative_file_path(const std::string &filename) const
std::filesystem::path get_canonical_path() const
static const std::string s_shadow_dir
static ProjectDirectory generate_random()
ProjectDirectory(const std::string &path=std::string())
std::filesystem::path get_shadow_filename(const std::string &extension=std::string()) const
std::filesystem::path get_default_filename(const std::string &extension=std::string()) const
std::filesystem::path get_shadow_dir() const