sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGXFileSystem;
part of SGEXTN module SG_FileSystem
provides access to the file system
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGXFileSystem.h›
CMake target for BuildLah: SGEXTN::SG_FileSystem
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
static SGXString configFilePath;
static SGXString userDataFilePath;
static int createFile(const SGXString& s);
static int createFolder(const SGXString& s);
static SGXString decodeFromFileName(const SGXString& s);
static int duplicateFile(const SGXString& startPath, const SGXString& endPath);
static int duplicateFolder(const SGXString& startPath, const SGXString& endPath);
static SGXString encodeToFileName(const SGXString& s);
static bool fileExists(const SGXString& s);
static bool folderExists(const SGXString& s);
static SGXTimeStamp getFileCreationTime(const SGXString& s);
static SGXString getFileExtension(const SGXString& s);
static SGXTimeStamp getFileLastEditTime(const SGXString& s);
static SGXString getFileName(const SGXString& s);
static SGXString getFileNameNoExtension(const SGXString& s);
static long long getFileSize(const SGXString& s);
static SGLArray‹SGXString› getFilesList(const SGXString& s);
static SGLArray‹SGXString› getFilesListContainingName(const SGXString& s, const SGXString& name);
static SGLArray‹SGXString› getFilesListContainingNameRecursive(const SGXString& s, const SGXString& name);
static SGLArray‹SGXString› getFilesListRecursive(const SGXString& s);
static SGLArray‹SGXString› getFilesListWithExtension(const SGXString& s, const SGXString& ext);
static SGLArray‹SGXString› getFilesListWithExtensionRecursive(const SGXString& s, const SGXString& ext);
static SGXTimeStamp getFolderCreationTime(const SGXString& s);
static SGXTimeStamp getFolderLastEditTime(const SGXString& s);
static SGXString getFolderName(const SGXString& s);
static long long getFolderSize(const SGXString& s);
static SGLArray‹SGXString› getFoldersList(const SGXString& s);
static SGXString getFreePath(const SGXString& prefix, const SGXString& unencodedName, const SGXString& postfix);
static SGXString getParentName(const SGXString& s);
static SGXString getParentPath(const SGXString& s);
static SGXString joinFilePaths(const SGXString& a, const SGXString& b);
static int moveFile(const SGXString& startPath, const SGXString& endPath);
static int moveFolder(const SGXString& startPath, const SGXString& endPath);
static bool numberAwareLesserThan(const SGXString& s1, const SGXString& s2);
static bool numberAwareLesserThanBase16(const SGXString& s1, const SGXString& s2);
static void openLink(const SGXString& link);
static bool pathIsSubfolder(const SGXString& childPath, const SGXString& parentPath);
static int permanentDeleteFile(const SGXString& s);
static int permanentDeleteFolder(const SGXString& s);
SGXFileSystem allows access to the file system. This includes iterating through files and folders, and querying for properties of files and folders. Use SGXFile instead to read and write files, and use SGXFileBinUtilities instead to manage the SGEXTN builtin file bin.
Internally uses QDir, QFileInfo, and QFile
The folder that you should keep application settings files in.
Setting this manually is undefined behaviour.
The folder that you should keep user data in.
Setting this manually is undefined behaviour.
Creates a file at s. This returns -2 if a file system error caused the operation to fail, 0 if the file already exists, and 1 if the operation was successful.
Creates a folder at s. This returns -2 if a file system error caused the operation to fail, 0 if the file already exists, and 1 if the operation was successful.
Reverses SGXFileSystem::encodeToFileName for s.
If s is not a valid encoded file name, this will return s.
Copies the file at startPath to endPath. This returns -2 if a file system error caused the operation to fail, 0 if there is already a file at endPath or if there is no file at startPath, and 1 if the operation was successful.
Copies the folder at startPath to endPath. This returns -2 if a file system error caused the operation to fail, 0 if there is already a folder at endPath or if there is no folder at startPath, and 1 if the operation was successful.
Encodes s to a file name, the SGEXTN provided encoding that is guaranteed to be safe on all file systems, including case insensitive ones. The file name is as readable as reasonably possible while allowing all Unicode characters.
Encoded file names always start with sg0
Returns if any file exists at s.
Returns if any folder exists at s.
Returns the time at which the file at s was created in the form of a SGXTimeStamp.
If there is no file at s or if file creation time is not supported by the file system, this returns SGXTimeStamp::zero.
Returns the extension of the file at path s. This does not include the dot.
Returns the time at which the file at s was last opened in a write capable mode.
If there is no file at s, this returns SGXTimeStamp::zero.
Returns the name of the file at path s.
Returns the file name of the file at path s with the extension removed.
Returns the size of the file at s in bytes.
If there is no file at s, this returns 0.
Returns a list of files inside folder s by their paths.
If s does not exist, an empty list is returned.
Returns a list of paths to files in folder s containing a substring of name in their names.
An empty list is returned if there is no folder at s.
Returns a list of paths to files in folder s including recursive subfolders containing a substring of name in their names.
An empty list is returned if there is no folder at s.
Returns a list of files inside folder s and its recursive subfolders by their paths.
If s does not exist, an empty list is returned.
Returns a list of paths to files in folder s with extension matching ext. ext should not include the dot.
An empty list is returned if there is no folder at s.
Returns a list of paths to files in folder s including recursive subfolders, with extension matching ext. ext should not include the dot.
An empty list is returned if there is no folder at s.
Returns the time at which the folder at s was created in the form of a SGXTimeStamp.
If there is no folder at s or if folder creation time is not supported by the file system, this returns SGXTimeStamp::zero.
Returns the time at which the folder at s was last opened in a write capable mode.
If there is no folder at s, this returns SGXTimeStamp::zero.
Returns the name of the folder at path s.
Returns the size of the folder at s, which is the sum of sizes of all its subfolders, in bytes.
If there is no folder at s, this returns 0.
Returns a list of subfolders inside folder s by their paths.
If s does not exist, an empty list is returned.
This should be used to replace directly setting the path as prefix/SGXFileSystem::encodeToFileName(unencodedName)postfix to avoid file name collisions causing accidental overwrite.
Returns the name of the parent folder of s.
Returns the path to the parent folder of s.
Returns the file path a/b, this handles automatically trailing slash in a and leading slash in b if any are present.
If either a or b is an empty string, this will crash.
Moves the file at startPath to endPath. This returns -2 if a file system error caused the operation to fail, 0 if there is already a file at endPath or if there is no file at startPath, and 1 if the operation was successful.
Moves the folder at startPath to endPath. This returns -2 if a file system error caused the operation to fail, 0 if there is already a folder at endPath or if there is no folder at startPath, and 1 if the operation was successful.
Comparator used by SGXNumberAwareFilePathLesserThan and SGXNumberAwareFilePathMoreThan, returns if a file with name s1 should be displayed in front of a file with name s2 when number aware lesser than sorting is used.
The file names are decoded before comparison.
Comparator used by SGXNumberAwareFilePathLesserThanBase16 and SGXNumberAwareFilePathMoreThanBase16, returns if a file with name s1 should be displayed in front of a file with name s2 when base16 number aware lesser than sorting is used.
The file names are decoded before comparison.
Opens the website link link in the system default browser.
There is no need to put the https:// in front of the link, just the website link itself is sufficient.
If the link is invalid or does not exist, the user's browser will see the error, this will not affect the application.
Returns if childPath is a possibly recursive subfolder of parentPath.
Permanently deletes the file at s. This returns -2 if a file system error caused the operation to fail, 0 if there is no file at s, and 1 if the operation was successful.
This can cause irreversible loss of user data if used on user files. Use this only on application generated settings files. For deleting user files, use SGXFileBinUtilities::deleteFile instead to allow recovery.
Permanently deletes the folder at s. This returns -2 if a file system error caused the operation to fail, 0 if there is no folder at s, and 1 if the operation was successful.
This can cause irreversible loss of user data if used on user files. Use this only on application generated settings files. For deleting user files, use SGXFileBinUtilities::deleteFolder instead to allow recovery.
©2025 05524F.sg (Singapore)