ComSDK
 Указатель Классы Пространства имен Функции Переменные Определения типов Перечисления Элементы перечислений Друзья Группы Страницы
Классы | Функции
Пространство имен com::fs

Средства для работы с файловой системой Подробнее...

Классы

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Путь
Возвращает
Преобразованный путь