![Logo](logo.png) |
User Guide
|
Go to the documentation of this file.
36 template <
typename Iter,
typename Cont>
37 bool is_last(Iter iter,
const Cont& cont) {
38 return ((iter != cont.end()) && (next(iter) == cont.end()));
41 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
66 template <
unsigned int SIZE = 4>
109 if (!status.second) {
111 status.first->second = new_string;
113 return status.first->second;
bool is_last(Iter iter, const Cont &cont)
Check if the iterator is pointing to last element in the container.
std::map< std::string, std::string > random_strings
std::map that keeps the random strings assigned to variables as suffix
encapsulates code generation backend implementations
SingletonRandomString & operator=(SingletonRandomString const &)=delete
Delete public "=" operator.
Singleton class for random strings.
UseNumbersInString
Enum to wrap bool variable to select if random string should have numbers or not.
const std::string & get_random_string(const std::string &var_name) const
Get the random string of the var_name variable.
static SingletonRandomString & instance()
Function to instantiate the SingletonRandomString class.
SingletonRandomString()=default
Constructor used by instance()
const std::string & reset_random_string(const std::string &var_name, UseNumbersInString use_numbers)
If var_name has already got a random string assigned remove it from map and assign a new one,...
static constexpr char envpathsep
The character conventionally used by the operating system to separate search path components.
bool random_string_exists(const std::string &var_name) const
Check if there is a random string assigned as suffix for the var_name variable.
std::string generate_random_string(const int len, UseNumbersInString use_numbers)
Generate random std::string of length len based on a uniform distribution.