mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
Merge branch 'check/next-cc'
again: it compiles, but is not really tested... Conflicts: acinclude.m4 src/driver/volume.cpp src/gui/infoviewer.cpp src/gui/osd_setup.cpp src/gui/start_wizard.cpp src/zapit/src/getservices.cpp
This commit is contained in:
@@ -284,6 +284,24 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string getPathName(std::string &path)
|
||||
{
|
||||
size_t pos = path.find_last_of("/");
|
||||
if (pos == std::string::npos)
|
||||
return path;
|
||||
return path.substr(0, pos);
|
||||
}
|
||||
|
||||
std::string getBaseName(std::string &path)
|
||||
{
|
||||
size_t pos = path.find_last_of("/");
|
||||
if (pos == std::string::npos)
|
||||
return path;
|
||||
if (path.length() == pos +1)
|
||||
return "";
|
||||
return path.substr(pos+1);
|
||||
}
|
||||
|
||||
std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/)
|
||||
{
|
||||
std::string result = str.erase(str.find_last_not_of(trimChars) + 1);
|
||||
|
Reference in New Issue
Block a user