Cogs.Foundation
|
Typedefs | |
using | RecursiveDirIterator = fs::recursive_directory_iterator |
using | DirectoryEntry = fs::directory_entry |
using | FileTimeType = fs::file_time_type |
Functions | |
COGSFOUNDATION_API void | readFileAsync (const std::string &fileName, const FileContents::Callback &callback, uint64_t offset=0, uint64_t size=0, FileContentsHints hints=FileContentsHints::None) |
COGSFOUNDATION_API FileContents::Ptr | readFileSync (const std::string &fileName, uint64_t offset=0, uint64_t size=0, FileContentsHints hints=FileContentsHints::None) |
COGSFOUNDATION_API bool | readTextFile (std::string &content, const std::string &fileName) |
COGSFOUNDATION_API void | autoExpandEnvironmentVariables (std::string &text) |
COGSFOUNDATION_API std::string | expandEnvironmentVariables (const std::string &input) |
COGSFOUNDATION_API std::string | expandEnvironmentVariable (const std::string &name) |
COGSFOUNDATION_API char | pathSeparator () |
COGSFOUNDATION_API bool | exists (std::string_view path) |
COGSFOUNDATION_API bool | isFile (std::string_view path) |
COGSFOUNDATION_API bool | isDirectory (std::string_view path) |
COGSFOUNDATION_API std::string | absolute (std::string_view path) |
COGSFOUNDATION_API std::string | canonical (std::string_view path) |
COGSFOUNDATION_API bool | remove (std::string_view path) |
COGSFOUNDATION_API std::string | combine (std::string_view path, std::string_view extensionPath) |
Combine the two paths with a directory separator. | |
COGSFOUNDATION_API std::string | expandPath (std::string_view fileName) |
COGSFOUNDATION_API std::string | parentPath (std::string_view str) |
COGSFOUNDATION_API std::string | relativePath (std::string_view str) |
COGSFOUNDATION_API std::string | relativePath (std::string_view str, std::string_view base) |
COGSFOUNDATION_API std::string | getPathToExe () |
COGSFOUNDATION_API std::string | getPathRelativeToDll (const std::string &fileName, void *handle) |
COGSFOUNDATION_API std::string | getTempPath () |
COGSFOUNDATION_API std::string | getAppDataPath () |
COGSFOUNDATION_API std::string | getOrgLocalDataPath () |
COGSFOUNDATION_API bool | isAbsolute (std::string_view str) |
COGSFOUNDATION_API bool | isRelative (std::string_view str) |
COGSFOUNDATION_API std::string | fileName (std::string_view str) |
COGSFOUNDATION_API std::string | extension (std::string_view str) |
COGSFOUNDATION_API std::string | stem (std::string_view str) |
COGSFOUNDATION_API void | replaceAll (std::string &str, std::string_view from, std::string_view to) |
COGSFOUNDATION_API FileTimeType | getFileTime (std::string_view path) |
COGSFOUNDATION_API uint64_t | getFileSize (std::string_view path) |
COGSFOUNDATION_API bool | writeBinaryFile (const std::string &fileName, const void *content, size_t contentSize) |
COGSFOUNDATION_API bool | createDirectories (std::string_view fileName) |
COGSFOUNDATION_API RecursiveDirIterator | directoryIterator (std::string_view directory) |
COGSFOUNDATION_API std::string | getPath (const DirectoryEntry &entry) |
COGSFOUNDATION_API bool | copyFile (std::string_view src, std::string_view dest) |
COGSFOUNDATION_API void | backupFile (const std::string &path, int max) |
COGSFOUNDATION_API FileHandle::Ptr | openFile (std::string_view path, FileHandle::OpenMode openMode, FileHandle::AccessMode accessMode) |
COGSFOUNDATION_API void | closeFile (const FileHandle::Ptr &handle) |
COGSFOUNDATION_API size_t | fileSize (const FileHandle::Ptr &handle) |
COGSFOUNDATION_API void * | mapFile (const FileHandle::Ptr &handle, FileHandle::ProtectionMode protectionMode, size_t offset, size_t size) |
COGSFOUNDATION_API void | unmapFile (const FileHandle::Ptr &handle) |
using Cogs::IO::DirectoryEntry = typedef fs::directory_entry |
using Cogs::IO::FileTimeType = typedef fs::file_time_type |
using Cogs::IO::RecursiveDirIterator = typedef fs::recursive_directory_iterator |
std::string Cogs::IO::absolute | ( | std::string_view | path | ) |
void Cogs::IO::autoExpandEnvironmentVariables | ( | std::string & | text | ) |
void Cogs::IO::backupFile | ( | const std::string & | path, |
int | max | ||
) |
std::string Cogs::IO::canonical | ( | std::string_view | path | ) |
void Cogs::IO::closeFile | ( | const FileHandle::Ptr & | handle | ) |
std::string Cogs::IO::combine | ( | std::string_view | path, |
std::string_view | extensionPath | ||
) |
Combine the two paths with a directory separator.
References replaceAll().
bool Cogs::IO::copyFile | ( | std::string_view | src, |
std::string_view | dest | ||
) |
References LOG_ERROR, and StringViewFormat.
bool Cogs::IO::createDirectories | ( | std::string_view | fileName | ) |
Cogs::IO::RecursiveDirIterator Cogs::IO::directoryIterator | ( | std::string_view | directory | ) |
bool Cogs::IO::exists | ( | std::string_view | path | ) |
std::string Cogs::IO::expandEnvironmentVariable | ( | const std::string & | name | ) |
std::string Cogs::IO::expandEnvironmentVariables | ( | const std::string & | input | ) |
std::string Cogs::IO::expandPath | ( | std::string_view | fileName | ) |
std::string Cogs::IO::extension | ( | std::string_view | str | ) |
Referenced by stem().
std::string Cogs::IO::fileName | ( | std::string_view | str | ) |
Referenced by stem().
size_t Cogs::IO::fileSize | ( | const FileHandle::Ptr & | handle | ) |
std::string Cogs::IO::getAppDataPath | ( | ) |
uint64_t Cogs::IO::getFileSize | ( | std::string_view | path | ) |
Cogs::IO::FileTimeType Cogs::IO::getFileTime | ( | std::string_view | path | ) |
Referenced by Cogs::Item::Item().
std::string Cogs::IO::getOrgLocalDataPath | ( | ) |
std::string Cogs::IO::getPath | ( | const DirectoryEntry & | entry | ) |
std::string Cogs::IO::getPathRelativeToDll | ( | const std::string & | fileName, |
void * | handle | ||
) |
std::string Cogs::IO::getPathToExe | ( | ) |
std::string Cogs::IO::getTempPath | ( | ) |
bool Cogs::IO::isAbsolute | ( | std::string_view | str | ) |
bool Cogs::IO::isDirectory | ( | std::string_view | path | ) |
bool Cogs::IO::isFile | ( | std::string_view | path | ) |
bool Cogs::IO::isRelative | ( | std::string_view | str | ) |
void * Cogs::IO::mapFile | ( | const FileHandle::Ptr & | handle, |
FileHandle::ProtectionMode | protectionMode, | ||
size_t | offset, | ||
size_t | size | ||
) |
Cogs::FileHandle::Ptr Cogs::IO::openFile | ( | std::string_view | path, |
FileHandle::OpenMode | openMode, | ||
FileHandle::AccessMode | accessMode | ||
) |
std::string Cogs::IO::parentPath | ( | std::string_view | str | ) |
References replaceAll().
char Cogs::IO::pathSeparator | ( | ) |
void Cogs::IO::readFileAsync | ( | const std::string & | fileName, |
const FileContents::Callback & | callback, | ||
uint64_t | offset = 0 , |
||
uint64_t | size = 0 , |
||
FileContentsHints | hints = FileContentsHints::None |
||
) |
Cogs::FileContents::Ptr Cogs::IO::readFileSync | ( | const std::string & | fileName, |
uint64_t | offset = 0 , |
||
uint64_t | size = 0 , |
||
FileContentsHints | hints = FileContentsHints::None |
||
) |
bool Cogs::IO::readTextFile | ( | std::string & | content, |
const std::string & | fileName | ||
) |
std::string Cogs::IO::relativePath | ( | std::string_view | str | ) |
std::string Cogs::IO::relativePath | ( | std::string_view | str, |
std::string_view | base | ||
) |
bool Cogs::IO::remove | ( | std::string_view | path | ) |
void Cogs::IO::replaceAll | ( | std::string & | str, |
std::string_view | from, | ||
std::string_view | to | ||
) |
Referenced by combine(), and parentPath().
std::string Cogs::IO::stem | ( | std::string_view | str | ) |
References extension(), and fileName().
void Cogs::IO::unmapFile | ( | const FileHandle::Ptr & | handle | ) |
bool Cogs::IO::writeBinaryFile | ( | const std::string & | fileName, |
const void * | content, | ||
size_t | contentSize | ||
) |