Add support for actions triggered by key combination

Change-Id: I9dfa7de40229f00412d63fc9c1eb3a809a6eb2e6
Signed-off-by: Vojtech Bocek <vbocek@gmail.com>
This commit is contained in:
Vojtech Bocek
2014-04-16 17:51:17 +02:00
committed by Gerrit Code Review
parent 9c102b536d
commit 0b7fe504dc
9 changed files with 145 additions and 48 deletions
+20
View File
@@ -1142,4 +1142,24 @@ void TWFunc::Fixup_Time_On_Boot()
#endif
}
std::vector<std::string> TWFunc::Split_String(const std::string& str, const std::string& delimiter, bool removeEmpty)
{
std::vector<std::string> res;
size_t idx = 0, idx_last = 0;
while(idx < str.size())
{
idx = str.find_first_of(delimiter, idx_last);
if(idx == std::string::npos)
idx = str.size();
if(idx-idx_last != 0 || !removeEmpty)
res.push_back(str.substr(idx_last, idx-idx_last));
idx_last = idx + delimiter.size();
}
return res;
}
#endif // ndef BUILD_TWRPTAR_MAIN