vitastor-disk prepare: implement first form of the command

This commit is contained in:
Vitaliy Filippov
2022-08-09 01:29:29 +03:00
parent ae99ee6266
commit 4c9aaa8a86
7 changed files with 357 additions and 49 deletions
+19
View File
@@ -56,6 +56,25 @@ std::string base64_decode(const std::string &in)
return out;
}
std::string strtolower(const std::string & in)
{
std::string s = in;
for (int i = 0; i < s.length(); i++)
{
s[i] = tolower(s[i]);
}
return s;
}
std::string trim(const std::string & in)
{
int begin = in.find_first_not_of(" \n\r\t");
if (begin == -1)
return "";
int end = in.find_last_not_of(" \n\r\t");
return in.substr(begin, end+1-begin);
}
uint64_t stoull_full(const std::string & str, int base)
{
if (isspace(str[0]))