8 #include <cpplocate/cpplocate_api.h> 33 CPPLOCATE_API
void replace(std::string & str,
const std::string & original,
const std::string & substitute);
42 CPPLOCATE_API
void trim(std::string & str);
54 CPPLOCATE_API std::string
trimPath(
const std::string & str);
66 CPPLOCATE_API std::string
trimPath(std::string && str);
78 CPPLOCATE_API std::string
unifiedPath(
const std::string & path);
90 CPPLOCATE_API std::string
unifiedPath(std::string && path);
116 CPPLOCATE_API
size_t posAfterString(
const std::string & str,
const std::string & substr);
153 CPPLOCATE_API
void split(
const std::string & str,
char delim, std::vector<std::string> & values);
167 CPPLOCATE_API std::string
join(
const std::vector<std::string> & values,
const std::string & delim);
181 CPPLOCATE_API
void getPaths(
const std::string & str, std::vector<std::string> & values);
193 CPPLOCATE_API std::string
getEnv(
const std::string & name);
205 CPPLOCATE_API
bool fileExists(
const std::string & path);
224 CPPLOCATE_API
bool loadModule(
const std::string & directory,
const std::string & name,
ModuleInfo & info);
CPPLOCATE_API std::string join(const std::vector< std::string > &values, const std::string &delim)
Join array of strings into a single string.
CPPLOCATE_API bool fileExists(const std::string &path)
Check if file or directory exists.
CPPLOCATE_API std::string unifiedPath(const std::string &path)
Convert path into unified form (replace '\' with '/')
CPPLOCATE_API std::string trimPath(const std::string &str)
Remove spaces and trailing slash/backslash from path.
CPPLOCATE_API void getPaths(const std::string &str, std::vector< std::string > &values)
Split list of paths separated by : or ; into list of paths.
CPPLOCATE_API std::string getDirectoryPath(const std::string &fullpath)
Cut away filename portion of a path, get path to directory.
CPPLOCATE_API void split(const std::string &str, char delim, std::vector< std::string > &values)
Split string into array of strings.
CPPLOCATE_API bool loadModule(const std::string &directory, const std::string &name, ModuleInfo &info)
Load module information file.
CPPLOCATE_API std::string getEnv(const std::string &name)
Get value of environment variable.
CPPLOCATE_API size_t posAfterString(const std::string &str, const std::string &substr)
Get position right after given substring (searched from right to left)
Description of a module, containing key/value pairs.
Definition: ModuleInfo.h:20
CPPLOCATE_API void replace(std::string &str, const std::string &original, const std::string &substitute)
Replace all occurences of a substring in string.
CPPLOCATE_API std::string getSystemBasePath(const std::string &path)
Get system base path for path to library or executable.
CPPLOCATE_API void trim(std::string &str)
Remove spaces at the beginning and the end of a string.
Definition: cpplocate.h:10