SSS - S3 Toolkit 0.9.6
S3 client library and applications
|
internal utility functions More...
#include <algorithm>
#include <functional>
#include <string>
#include <unordered_map>
Data Structures | |
class | sss::SplitIterator |
Iterator over splits. More... | |
class | sss::SplitRange |
Range over splits. More... | |
Functions | |
template<class ContainerT > | |
void | sss::Split (const std::string &str, ContainerT &cont, const std::string &delims=" ", const size_t count=std::string::npos) |
auto | sss::begin (const SplitRange &sr) |
return iterator at start position | |
auto | sss::end (const SplitRange &sr) |
return iterator at end position | |
int | sss::RandomIndex (int lowerBound, int upperBound) |
size_t | sss::FileSize (const std::string &filename) |
Toml | sss::ParseTomlFile (const std::string &filename) |
std::string | sss::GetHomeDir () |
void | sss::TrimLine (std::string &s) |
std::string | sss::ToUpper (std::string s) |
std::string | sss::ToLower (std::string s) |
internal utility functions
size_t sss::FileSize | ( | const std::string & | filename | ) |
Return file size
filename | file name |
References sss::FileSize().
std::string sss::GetHomeDir | ( | ) |
Return home directory
References sss::GetHomeDir().
Toml sss::ParseTomlFile | ( | const std::string & | filename | ) |
Parse Toml file in AWS format and return tree as map of maps
Works with AWS format (nested s'=') Parent key is added added to child key: <parent key>/<child_key>'
filename | location of configuration file |
References sss::GetHomeDir(), and sss::ParseTomlFile().
int sss::RandomIndex | ( | int | lowerBound, |
int | upperBound | ||
) |
Return integer in [low,high] range
lowerBound | lower bound |
upperBound | upper bound |
lowerBound
, upperBound
] References sss::RandomIndex().
void sss::Split | ( | const std::string & | str, |
ContainerT & | cont, | ||
const std::string & | delims = " " , |
||
const size_t | count = std::string::npos |
||
) |
Split string and put substrings into container
[in] | str | input text |
[out] | cont | container with push_back() method |
[in] | delims | delimiter |
[in] | count | number of delimiters to parse |
References sss::Split().
std::string sss::ToLower | ( | std::string | s | ) |
Convert to lowercase
s | text |
References sss::ToLower().
std::string sss::ToUpper | ( | std::string | s | ) |
Convert to uppercase text
s | text |
References sss::ToUpper().
void sss::TrimLine | ( | std::string & | s | ) |
Remove leading '#' and leading and trailing blanks in place
References sss::TrimLine().