4 using namespace CYB::API::String;
7 for (
auto I(AString.RawLength() - 1); I >= 0; --I)
8 if (AString.CString()[I] == ASeparator)
14 SetPath(std::move(APath));
18 Path(LocateDirectory(ADirectory))
22 UTF8 CurrentPath(std::move(ABasePath));
23 for (
auto& PathAddition : APaths) {
24 CurrentPath += DirectorySeparatorChar();
25 CurrentPath += PathAddition;
26 CreateDirectory(CurrentPath);
35 auto FirstPath(LocateDirectory(SystemPath::EXECUTABLE));
52 if (FPath.RawLength() + AAppendage.
RawLength() + 1 > MAX_PATH_BYTES)
59 auto NewPath(FPath + DirectorySeparatorChar() + AAppendage);
61 if (!ACreateIfNonExistant) {
63 if (!Verify(NewPath)) {
65 const auto I(GetIndexOfLastSeperator(NewPath, *DirectorySeparatorChar()));
67 FinalComponent =
UTF8(static_cast<const Dynamic&>(NewPath).SubString(I, NewPath.RawLength() - I));
68 NewPath =
UTF8(static_cast<const Dynamic&>(NewPath).SubString(0, I));
77 if (ACreateRecursive) {
80 auto DynTokens(AAppendage.
Tokenize(*DirectorySeparatorChar()));
81 for (
auto& Tok : DynTokens)
82 Tokens.emplace_back(std::move(Tok));
83 WorkingPath =
UTF8(FPath);
86 const auto I(GetIndexOfLastSeperator(AAppendage, *DirectorySeparatorChar()));
88 Tokens.emplace_back(
UTF8(AAppendage));
89 WorkingPath =
UTF8(FPath);
92 Tokens.emplace_back(
UTF8(static_cast<const Dynamic&>(AAppendage).SubString(I + 1, AAppendage.
RawLength() - I - 1)));
93 WorkingPath =
UTF8(static_cast<const Dynamic&>(AAppendage).SubString(0, AAppendage.
RawLength()));
94 if (!Verify(WorkingPath))
98 const Static Ascender(u8
"..");
99 for (
auto& Tok : Tokens)
104 CreateDirectories(std::move(WorkingPath), Tokens);
116 NewPath += std::move(FinalComponent);
117 SetPath(std::move(NewPath));
126 else if (Verify(FPath)) {
128 auto Entry(Contents());
129 for (
auto& It(Entry()); It->Valid(); ++It)
130 (*It)().Delete(
true);
133 DeleteDirectory(FPath);
148 return !IsDirectory();
152 return FPath.RawLength();
156 auto Full(FullName());
157 const auto Dot(GetIndexOfLastSeperator(Full,
'.') + 1);
160 return UTF8(static_cast<const Dynamic&>(Full).SubString(Dot, Full.RawLength() - Dot));
172 return &FPathListing;
A variable length UTF-8 string.
Template type for wrapping pointers and treating them as objects. Only works with CyberEngine interfa...
API::Interop::Context & Context(void) noexcept
Get the API's Context.
Failed to evaluate a Path.
Iterator for paths in a directory.
Container::Deque< Dynamic > Tokenize(const char ASeparator) const
Split the string into a Deque of other strings based on a seperator.
int RawLength(void) const noexcept
Get the byte length of the contained CString.
API::Interop::Object< API::Path > * operator->(void) noexceptfinaloverride
Get the current path the iterator points to. Must be checked for validity after iteration. If invalid, end of iteration has been reached. Can be moved.
Uses the FindFile API to enumerate directories.
Attempted to use a path greater than the maximum allowed byte value.
A string pointing to unchanging data in the stack above it or the data segment. Must have UTF-8 encod...
Object< AObject > ConstructObject(AArgs &&...AArguments)
Allocates the Object specified by AObject using a specified Constructor.
static void LessThan(const AType &ALHS, const AType &ARHS) noexcept
Less than assertion function. May not be evaluated.
SystemPath
Starting points for creating paths.
A string could not be validated.
Mutex could not be created.
const unsigned int FErrorCode
The assigned error code.
A previously valid path has become invalidated, most likely due to deletion.
Exceptions caused by external call failures or invalid external data. Only classifies ones that can p...
A heap has no block large enough for a requested allocation and expansion failed. ...
Allocator & FAllocator
The Allocator.
std::deque< AType, Interop::STLAllocator< AType >> Deque
std::deque algorithms using the CyberEngine's allocator
Generic error for read failures. See functions for further documentation.
Precompiled header for inter-engine operations.
API::Interop::Object< API::Path > & operator*(void) noexceptfinaloverride
Get the current path the iterator points to. Must be checked for validity after iteration. If invalid, end of iteration has been reached. Can be moved.
A system path could not be retrieved.
Exceptions that are thrown internally in the engine that the should never see, these are a superset o...
Tried to delete a non-empty directory.
ErrorCode
The error code of the exception.
Used for object which aren't allocatables.
Generic error for write failures. See functions for further documentation.