mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
added support for custom tokens in dislaychannel
This commit is contained in:
@@ -121,6 +121,24 @@ bool FirstFileInFolder(string &path, string &extension, string &fileName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// trim from start
|
||||
string <rim(string &s) {
|
||||
s.erase(s.begin(), find_if(s.begin(), s.end(), not1(ptr_fun<int, int>(isspace))));
|
||||
return s;
|
||||
}
|
||||
|
||||
// trim from end
|
||||
string &rtrim(string &s) {
|
||||
s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
|
||||
return s;
|
||||
}
|
||||
|
||||
// trim from both ends
|
||||
string &trim(string &s) {
|
||||
return ltrim(rtrim(s));
|
||||
}
|
||||
|
||||
|
||||
// split: receives a char delimiter; returns a vector of strings
|
||||
// By default ignores repeated delimiters, unless argument rep == 1.
|
||||
vector<string>& splitstring::split(char delim, int rep) {
|
||||
|
@@ -16,6 +16,10 @@ bool FileExists(const string &path, const string &name, const string &ext);
|
||||
bool FolderExists(const string &path);
|
||||
bool FirstFileInFolder(string &path, string &extension, string &fileName);
|
||||
|
||||
string <rim(string &s);
|
||||
string &rtrim(string &s);
|
||||
string &trim(string &s);
|
||||
|
||||
class splitstring : public std::string {
|
||||
std::vector<std::string> flds;
|
||||
public:
|
||||
|
Reference in New Issue
Block a user