Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Include/Pipe/Core/Name.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <tsl/robin_set.h>

#include <mutex>
#include <shared_mutex>


Expand Down
1 change: 0 additions & 1 deletion Include/Pipe/Core/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "Pipe/Reflect/TypeName.h"
#include "Pipe/Serialize/SerializationFwd.h"

#include <fmt/chrono.h>
#include <fmt/format.h>
#include <utf8.h>

Expand Down
2 changes: 1 addition & 1 deletion Include/Pipe/Files/Files.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace p::files
PIPE_API bool LoadStringFile(const Path& path, String& result, sizet extraPadding = 0);
PIPE_API bool SaveStringFile(const Path& path, StringView data);

PIPE_API void CreateFolder(const Path& path, bool bRecursive = false);
PIPE_API bool CreateFolder(const Path& path, bool bRecursive = false);
PIPE_API bool Delete(const Path& path, bool bExcludeIfNotEmpty = true, bool bLogErrors = true);

PIPE_API Iterator CreateIterator(const Path& path);
Expand Down
2 changes: 1 addition & 1 deletion Include/Pipe/Files/Paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace p::files
PIPE_API bool IsRelativePath(const Path& path);
PIPE_API bool IsAbsolutePath(const Path& path);
PIPE_API String ToString(const Path& path);
PIPE_API Path FromString(StringView pathStr);
PIPE_API Path ToPath(StringView pathStr);
} // namespace p::files

namespace p
Expand Down
15 changes: 8 additions & 7 deletions Src/Files/Files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ namespace p::files
return !result.empty();
}

void CreateFolder(const Path& path, bool bRecursive)
bool CreateFolder(const Path& path, bool bRecursive)
{
if (IsFolder(path) && !Exists(path))
{
if (bRecursive)
{
CreateFolder(path.parent_path(), bRecursive);
}
fs::create_directory(path);
return fs::create_directory(path);
}
return false;
}

bool SaveStringFile(const Path& path, StringView data)
Expand Down Expand Up @@ -166,26 +167,26 @@ namespace p::files

bool LoadStringFile(const String& path, String& result, sizet extraPadding)
{
return LoadStringFile(FromString(path), result, extraPadding);
return LoadStringFile(ToPath(path), result, extraPadding);
}

bool SaveStringFile(const String& path, StringView data)
{
return SaveStringFile(FromString(path), data);
return SaveStringFile(ToPath(path), data);
}

bool Exists(const String& path)
{
return Exists(FromString(path));
return Exists(ToPath(path));
}

bool IsFolder(const String& path)
{
return IsFolder(FromString(path));
return IsFolder(ToPath(path));
}

bool IsFile(const String& path)
{
return IsFile(FromString(path));
return IsFile(ToPath(path));
}
} // namespace p::files
4 changes: 2 additions & 2 deletions Src/Files/Paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace p::files
{
Path GetBasePath()
{
return FromString(PlatformProcess::GetBasePath());
return ToPath(PlatformProcess::GetBasePath());
}

#if PLATFORM_WINDOWS
Expand Down Expand Up @@ -222,7 +222,7 @@ namespace p::files
return path.string<TChar, std::char_traits<TChar>, STLAllocator<TChar>>();
}

Path FromString(StringView pathStr)
Path ToPath(StringView pathStr)
{
Path path;
path.assign(pathStr);
Expand Down
2 changes: 1 addition & 1 deletion Src/Files/STDFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace p
{
p::String str;
ct.Serialize(str);
value = p::FromString(str);
value = p::ToPath(str);
}

void Write(p::Writer& ct, const p::Path& value)
Expand Down