ComSDK
|
Средства для работы с файловой системой Подробнее...
Классы | |
class | FilenameEqual |
Функции | |
template<class FS > | |
int | seekStreamTo (FS &p_fstream, const char *p_keyword) |
MAC_DLLEXPORT std::string | getHostModuleFullPath () |
MAC_DLLEXPORT std::string | getFullPathByRelativeDir (const std::string &p_rel_dir) |
MAC_DLLEXPORT std::string | getPluginsFullPath () |
MAC_DLLEXPORT std::string | getPythonScriptsFullPath () |
MAC_DLLEXPORT std::string | getExternalBinariesFullPath () |
MAC_DLLEXPORT std::string | getFullPath (const std::string &p_relative_path, const std::string &p_filename="") |
MAC_DLLEXPORT std::string | getCFGFullPath () |
MAC_DLLEXPORT std::string | getXMLFullPath () |
MAC_DLLEXPORT std::string | getStrFormatedCode (int p_id, int p_format_length) |
MAC_DLLEXPORT bool | fileExists (const std::string &p_fullFilename) |
MAC_DLLEXPORT bool | libExists (const std::string &p_fullLibPath) |
MAC_DLLEXPORT std::string | createResultFilename (const std::string &p_name, char p_separator, int p_not_existent_id, int p_digits, const std::string &p_extension) |
MAC_DLLEXPORT std::string | getPathWOFilename (const std::string &p_path) |
MAC_DLLEXPORT std::string | getFilenameWOPath (const std::string &p_path) |
MAC_DLLEXPORT std::string | getFileExtension (const std::string &p_filename) |
MAC_DLLEXPORT std::string | getFilenameWOExtension (const std::string &p_filename) |
MAC_DLLEXPORT bool | fileGetLine (std::ifstream &is, std::string &line) |
MAC_DLLEXPORT std::string | slash () |
MAC_DLLEXPORT std::string | nativeSlash () |
MAC_DLLEXPORT std::string | toNativeSlash (const std::string &p_path) |
Средства для работы с файловой системой
Средства для доступа в файловой системе, получения стандартный каталогов, а также функции для кроссплатформенного создания путей к файлам и директориям.
MAC_DLLEXPORT std::string com::fs::createResultFilename | ( | const std::string & | p_name, |
char | p_separator, | ||
int | p_not_existent_id, | ||
int | p_digits, | ||
const std::string & | p_extension | ||
) |
Формирует имя файла в соответствии с именем, разделителем, номером, количеством цифр и расширением
[in] | p_name | Начальное имя |
[in] | p_separator | Разделитель |
[in] | p_not_existent_id | Номер |
[in] | p_digits | Количество значимых цифр |
[in] | p_extension | Расширение |
MAC_DLLEXPORT bool com::fs::fileExists | ( | const std::string & | p_fullFilename | ) |
Проверяет, существует ли указанный файл
bool com::fs::fileGetLine | ( | std::ifstream & | is, |
std::string & | line | ||
) |
Читает строку из файлового потока
string com::fs::getCFGFullPath | ( | ) |
Возвращает стандартную cfg-настроек
string com::fs::getExternalBinariesFullPath | ( | ) |
Возвращает стандартную директорию внешних исполняемых файлов
MAC_DLLEXPORT std::string com::fs::getFileExtension | ( | const std::string & | p_filename | ) |
Возвращает расширение файла
MAC_DLLEXPORT std::string com::fs::getFilenameWOExtension | ( | const std::string & | p_filename | ) |
Возвращает имя файла без расширения
std::string com::fs::getFilenameWOPath | ( | const std::string & | p_path | ) |
Возвращает имя файла без пути
MAC_DLLEXPORT std::string com::fs::getFullPath | ( | const std::string & | p_relative_path, |
const std::string & | p_filename = "" |
||
) |
Возвращает полный путь относительно директории приложения
[in] | p_relative_path | Относительный путь |
[in] | p_filename | Имя файла |
MAC_DLLEXPORT std::string com::fs::getFullPathByRelativeDir | ( | const std::string & | p_rel_dir | ) |
Возвращает абсолютный путь по заданному относительному пути
[in] | p_rel_dir | Относительный путь |
string com::fs::getHostModuleFullPath | ( | ) |
Возвращает директорию запущенного приложения
[out] | o_full_path | Директория запущенного приложения |
MAC_DLLEXPORT std::string com::fs::getPathWOFilename | ( | const std::string & | p_path | ) |
Возвращает путь без имени файла
string com::fs::getPluginsFullPath | ( | ) |
Возвращает стандартную директорию плагинов
string com::fs::getPythonScriptsFullPath | ( | ) |
Возвращает стандартную директорию python-скриптов
string com::fs::getStrFormatedCode | ( | int | p_id, |
int | p_format_length | ||
) |
Преобразовывает код ошибки в строку указанной длины, где оставшиеся символы будут заполнены нулями (например, 000015)
[in] | p_id | Код ошибки |
[in] | p_format_length | Требуемая длина строки |
string com::fs::getXMLFullPath | ( | ) |
Возвращает стандартную xml-настроек
bool com::fs::libExists | ( | const std::string & | p_fullLibPath | ) |
Проверяет, существует ли динамическая библиотека (имя самой библиотеки может быть без lib, so, dll и т.д.)
std::string com::fs::nativeSlash | ( | ) |
Возвращает платформо-зависимый слеш
std::string com::fs::slash | ( | ) |
Возвращает unix-слеш, который подходит для большинства случаев использования
std::string com::fs::toNativeSlash | ( | const std::string & | p_path | ) |
Заменяет все слеши в пути на платформо-зависимые
[in] | p_path | Путь |