diff options
author | methodus <methodus@web.de> | 2012-11-29 00:17:50 +0100 |
---|---|---|
committer | methodus <methodus@web.de> | 2012-11-29 00:17:50 +0100 |
commit | e6c28c5209b5508a61affc947179260cec0d2733 (patch) | |
tree | 2db88f7fe2d9f55309a267b35c401844cc657a08 /common | |
parent | 387d734f97d9b7ad710eb84d2390e1cfe3f56c1d (diff) | |
download | vdr-plugin-upnp-e6c28c5209b5508a61affc947179260cec0d2733.tar.gz vdr-plugin-upnp-e6c28c5209b5508a61affc947179260cec0d2733.tar.bz2 |
Added some SQLite pragmas which should reduce accesses on the file system for writing
Diffstat (limited to 'common')
-rw-r--r-- | common/tools.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/tools.cpp b/common/tools.cpp index 6f02d2a..1e40ccc 100644 --- a/common/tools.cpp +++ b/common/tools.cpp @@ -74,6 +74,18 @@ StringVector GetNetworkInterfaces(bool skipLoop){ return interfaces; } +string Trim(const std::string& str, const std::string& whitespace) +{ + const unsigned long int strBegin = str.find_first_not_of(whitespace); + if (strBegin == std::string::npos) + return ""; // no content + + const unsigned long int strEnd = str.find_last_not_of(whitespace); + const unsigned long int strRange = strEnd - strBegin + 1; + + return str.substr(strBegin, strRange); +} + string ToString(long number){ stringstream ss; ss << number; |