15#include "AUI/Reflect/AEnumerate.h"
16#include <AUI/Common/AString.h>
17#include <AUI/Common/ADeque.h>
18#include <AUI/Common/AVector.h>
19#include <AUI/Traits/serializable.h>
31 USE_SYSTEM_PATHS = 1 << 0,
55 DONT_IGNORE_DOTS = 1 << 0,
65 REGULAR_FILES = 1 << 2,
83 DEFAULT_FLAGS = AFileListFlags::DIRS | AFileListFlags::REGULAR_FILES
108 APath ensureSlashEnding()
const;
109 APath ensureNonSlashEnding()
const;
111 void removeBackSlashes();
115 struct _stat64 stat() const;
117 struct stat stat() const;
133 APath(
const char* utf8, std::size_t length)
noexcept:
AString(utf8, utf8 + length) {
140 APath(
const char16_t * str, std::size_t length)
noexcept:
AString(str, str + length) {
148 const APath& touch()
const;
153 AString systemSlashDirection()
const;
159 APath absolute()
const;
167 ADeque<APath> listDir(AFileListFlags f = AFileListFlags::DEFAULT_FLAGS)
const;
173 [[nodiscard]]
APath parent()
const;
181 [[nodiscard]]
APath file(
const AString& fileName)
const;
188 [[nodiscard]]
APath filename()
const;
195 [[nodiscard]]
APath filenameWithoutExtension()
const;
202 [[nodiscard]]
APath withoutUppermostFolder()
const;
220 bool isRegularFileExists()
const;
227 bool isDirectoryExists()
const;
233 const APath& removeFile()
const;
239 const APath& removeFileRecursive()
const;
245 const APath& makeDir()
const;
251 const APath& makeDirs()
const;
264 APath extensionChanged(
const AString& newExtension)
const;
270 bool isAbsolute()
const;
276 return !isAbsolute();
279 time_t fileModifyTime()
const;
280 size_t fileSize()
const;
282 const APath& chmod(
int newMode)
const;
314 static APath getDefaultPath(DefaultPath path);
321 static void copy(
const APath& source,
const APath& destination);
328 static void move(
const APath& source,
const APath& destination);
333 static APath workingDir();
355 return file(filename);
361inline APath operator""_path(
const char* str, std::size_t length) {
362 return APath(str, length);
A std::deque with AUI extensions.
Definition: ADeque.h:27
An add-on to AString with functions for working with the path.
Definition: APath.h:106
DefaultPath
Definition: APath.h:284
@ HOME
User home directory. Windows: User's home folder (C:\Users\USERNAME) Linux: /home/$USER.
Definition: APath.h:306
@ TEMP
Folder for temporary data. Windows: User's temp folder (temp%) Linux: /tmp Android: <internal_storage...
Definition: APath.h:299
@ APPDATA
Folder for application data. Windows: C:/Users/user%/.appdata/Roaming/ Linux: homedir%/....
Definition: APath.h:291
APath operator/(const AString &filename) const
Path of the child element. Relevant only for folders.
Definition: APath.h:354
bool isRelative() const
Checks whether path absolute or not.
Definition: APath.h:275
Represents a Unicode character string.
Definition: AString.h:37
A std::vector with AUI extensions.
Definition: AVector.h:38
@ NONE
Image is kept in it's original size.
AUI_ENUM_FLAG(APathFinder)
Flag enum for APath::find.
Definition: APath.h:25
Definition: serializable.h:26