mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
Merge remote-tracking branch 'check/next-cc'
needs buildfixing...
Conflicts:
src/eitd/sectionsd.cpp
src/gui/audioplayer.cpp
src/gui/bedit/bouqueteditor_channels.cpp
src/gui/infoclock.cpp
src/gui/infoviewer.cpp
src/gui/motorcontrol.cpp
src/gui/osd_setup.cpp
src/gui/scan.cpp
src/gui/scan_setup.cpp
src/gui/streaminfo2.cpp
src/gui/update.cpp
src/gui/widget/progresswindow.cpp
src/gui/widget/textbox.cpp
src/neutrino.cpp
src/zapit/include/zapit/femanager.h
Origin commit data
------------------
Branch: ni/coolstream
Commit: 32de6beef0
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-09-01 (Sun, 01 Sep 2013)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -284,17 +284,17 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string getPathName(std::string &path)
|
||||
std::string _getPathName(std::string &path, std::string sep)
|
||||
{
|
||||
size_t pos = path.find_last_of("/");
|
||||
size_t pos = path.find_last_of(sep);
|
||||
if (pos == std::string::npos)
|
||||
return path;
|
||||
return path.substr(0, pos);
|
||||
}
|
||||
|
||||
std::string getBaseName(std::string &path)
|
||||
std::string _getBaseName(std::string &path, std::string sep)
|
||||
{
|
||||
size_t pos = path.find_last_of("/");
|
||||
size_t pos = path.find_last_of(sep);
|
||||
if (pos == std::string::npos)
|
||||
return path;
|
||||
if (path.length() == pos +1)
|
||||
@@ -302,6 +302,36 @@ std::string getBaseName(std::string &path)
|
||||
return path.substr(pos+1);
|
||||
}
|
||||
|
||||
std::string getPathName(std::string &path)
|
||||
{
|
||||
return _getPathName(path, "/");
|
||||
}
|
||||
|
||||
std::string getBaseName(std::string &path)
|
||||
{
|
||||
return _getBaseName(path, "/");
|
||||
}
|
||||
|
||||
std::string getFileName(std::string &file)
|
||||
{
|
||||
return _getPathName(file, ".");
|
||||
}
|
||||
|
||||
std::string getFileExt(std::string &file)
|
||||
{
|
||||
return _getBaseName(file, ".");
|
||||
}
|
||||
|
||||
|
||||
std::string getNowTimeStr(const char* format)
|
||||
{
|
||||
char tmpStr[256];
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec));
|
||||
return (std::string)tmpStr;
|
||||
}
|
||||
|
||||
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