![]() |
cpplocate
1.0.0.a8d87a94e3ab
C++ Locator Library
|
Functions | |
CPPLOCATE_API void | replace (std::string &str, const std::string &original, const std::string &substitute) |
CPPLOCATE_API void | trim (std::string &str) |
CPPLOCATE_API std::string | trimPath (const std::string &str) |
CPPLOCATE_API std::string | trimPath (std::string &&str) |
CPPLOCATE_API std::string | unifiedPath (const std::string &path) |
CPPLOCATE_API std::string | unifiedPath (std::string &&path) |
CPPLOCATE_API std::string | getDirectoryPath (const std::string &fullpath) |
CPPLOCATE_API size_t | posAfterString (const std::string &str, const std::string &substr) |
CPPLOCATE_API std::string | getSystemBasePath (const std::string &path) |
CPPLOCATE_API void | split (const std::string &str, char delim, std::vector< std::string > &values) |
CPPLOCATE_API std::string | join (const std::vector< std::string > &values, const std::string &delim) |
CPPLOCATE_API void | getPaths (const std::string &str, std::vector< std::string > &values) |
CPPLOCATE_API std::string | getEnv (const std::string &name) |
CPPLOCATE_API bool | fileExists (const std::string &path) |
CPPLOCATE_API bool | loadModule (const std::string &directory, const std::string &name, ModuleInfo &info) |
CPPLOCATE_API void cpplocate::utils::replace | ( | std::string & | str, |
const std::string & | original, | ||
const std::string & | substitute | ||
) |
Replace all occurences of a substring in string.
[in,out] | str | String |
[in] | original | Original string |
[in] | substitute | Substitute string |
CPPLOCATE_API void cpplocate::utils::trim | ( | std::string & | str | ) |
Remove spaces at the beginning and the end of a string.
[in,out] | str | String |
CPPLOCATE_API std::string cpplocate::utils::trimPath | ( | const std::string & | str | ) |
Remove spaces and trailing slash/backslash from path.
[in] | path | Path |
CPPLOCATE_API std::string cpplocate::utils::trimPath | ( | std::string && | str | ) |
Remove spaces and trailing slash/backslash from path.
[in] | path | Path |
CPPLOCATE_API std::string cpplocate::utils::unifiedPath | ( | const std::string & | path | ) |
Convert path into unified form (replace '\' with '/')
[in] | path | Path |
CPPLOCATE_API std::string cpplocate::utils::unifiedPath | ( | std::string && | path | ) |
Convert path into unified form (replace '\' with '/')
[in] | path | Path |
CPPLOCATE_API std::string cpplocate::utils::getDirectoryPath | ( | const std::string & | fullpath | ) |
Cut away filename portion of a path, get path to directory.
[in] | fullpath | Path (e.g., '/path/to/file.txt') |
CPPLOCATE_API size_t cpplocate::utils::posAfterString | ( | const std::string & | str, |
const std::string & | substr | ||
) |
Get position right after given substring (searched from right to left)
[in] | str | Full string |
[in] | substr | Substring to search for |
CPPLOCATE_API std::string cpplocate::utils::getSystemBasePath | ( | const std::string & | path | ) |
Get system base path for path to library or executable.
[in] | path | Path to library or executable (e.g., '/usr/bin/myapp') |
Examples: '/usr/bin/myapp' -> '/usr' '/usr/local/bin/myapp' -> '/usr/local' '/usr/lib/mylib.so' -> '/usr' '/usr/lib64/mylib.so' -> '/usr' '/usr/local/lib64/mylib.so' -> '/usr/local' '/crosscompile/armv4/usr/lib/mylib.so.2' -> '/crosscompile/armv4/usr'
CPPLOCATE_API void cpplocate::utils::split | ( | const std::string & | str, |
char | delim, | ||
std::vector< std::string > & | values | ||
) |
Split string into array of strings.
[in] | str | Input string |
[in] | delim | Delimiter used to split the string |
[out] | values | Output vector |
CPPLOCATE_API std::string cpplocate::utils::join | ( | const std::vector< std::string > & | values, |
const std::string & | delim | ||
) |
Join array of strings into a single string.
[out] | values | Input vector |
[in] | delim | Delimiter used to join the string |
CPPLOCATE_API void cpplocate::utils::getPaths | ( | const std::string & | str, |
std::vector< std::string > & | values | ||
) |
Split list of paths separated by : or ; into list of paths.
[in] | paths | Input string |
[out] | values | Output vector |
CPPLOCATE_API std::string cpplocate::utils::getEnv | ( | const std::string & | name | ) |
Get value of environment variable.
[in] | name | Name of environment variable |
CPPLOCATE_API bool cpplocate::utils::fileExists | ( | const std::string & | path | ) |
Check if file or directory exists.
[in] | path | Path to file or directory |
CPPLOCATE_API bool cpplocate::utils::loadModule | ( | const std::string & | directory, |
const std::string & | name, | ||
ModuleInfo & | info | ||
) |
Load module information file.
[in] | directory | Path to directory |
[in] | name | Module name |
[out] | info | Module information |