#pragma once
#include "../string/String.hpp"
namespace sprawl
{
namespace path
{
char Separator();
char AltSeparator();
char ExtSeparator();
char PathSeparator();
char DriveSeparator();
String AbsolutePath(String const& path);
String Basename(String const& path);
String Dirname(String const& path);
bool Exists(String const& path);
bool LinkExists(String const& path);
String ExpandPath(String const& path);
int64_t GetAccessTime(String const& path);
int64_t GetModificationTime(String const& path);
int64_t GetSize(String const& path);
bool IsAbsolute(String const& path);
bool IsFile(String const& path);
bool IsDirectory(String const& path);
bool IsLink(String const& path);
bool IsMountPoint(String const& path);
namespace detail
{
template<typename T>
void Join(StringBuilder& builder, T const& lastItem)
{
builder << lastItem;
}
template<typename T, typename... Params>
void Join(StringBuilder& builder, T const& nextItem, Params const&... params)
{
builder << nextItem << Separator();
Join(builder, params...);
}
}
template<typename T, typename... Params>
String Join(T const& begin, Params const&... params)
{
sprawl::StringBuilder b;
detail::Join(b, begin, params...);
return b.Str();
}
String NormCase(String const& path);
String NormPath(String const& path);
String RealPath(String const& path);
String RelativePath(String const& path, String const& relativeTo = StringLiteral("./"));
bool SameFile(String const& path1, String const& path2);
struct SplitResult
{
String dirname;
String basename;
};
SplitResult Split(String const& path);
struct DriveResult
{
String drive;
String tail;
};
DriveResult SplitDrive(String const& path);
struct ExtResult
{
String path;
String extension;
};
ExtResult SplitExt(String const& path);
String CommonPrefix(String const& path1, String const& path2);
}
}
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #1 | 23398 | ququlala | "Forking branch Mainline of shadauxcat-libsprawl to ququlala-libsprawl." | ||
| //guest/ShadauxCat/Sprawl/Mainline/filesystem/path.hpp | |||||
| #2 | 14781 | ShadauxCat |
-Finished path library -Added some more functionality to filesystem library -Added a few more unit tests, still more needed for path #review-14782 |
||
| #1 | 14761 | ShadauxCat |
First drop of code for sprawl::filesystem and sprawl::path. Library will continue to grow. Also fixed a warning on linux. #review-14762 |
||