indigoX
indigox::utils Namespace Reference

Classes

class  FileReader
 Class for reading simple text file from disk. More...
 
struct  SimpleBiMap
 

Enumerations

enum  Option
 

Functions

std::string GetRandomString (size_t length, size_t seed=0)
 Generate a random string. More...
 
Option operator & (Option l, Option r)
 
Option operator| (Option l, Option r)
 
std::string ToLower (const std::string &s)
 Convert a string to lower case. More...
 
std::string ToUpper (const std::string &s)
 Convert a string to upper case. More...
 
std::string ToUpperFirst (const std::string &s)
 Convert a string to lower case with a single leading upper case. More...
 
template<typename T , typename __Iter >
__Iter WeakContainsShared (__Iter b, __Iter e, std::shared_ptr< T > x)
 Check if a given shared_ptr<T> is in a weak_ptr<T> container. More...
 

Enumeration Type Documentation

◆ Option

enum Option
strong
Enumerator
Yes 
No 
Auto 
Default 
All 
Some 
None 

Function Documentation

◆ GetRandomString()

std::string indigox::utils::GetRandomString ( size_t  length,
size_t  seed = 0 
)

Generate a random string.

All upper and lower case letters are available.

Parameters
lengththe number of characters to generate.
seedthe seed for the random number generator. If
Returns
the randomly generated string.

◆ operator &()

Option indigox::utils::operator & ( Option  l,
Option  r 
)
inline

◆ operator|()

Option indigox::utils::operator| ( Option  l,
Option  r 
)
inline

◆ ToLower()

std::string indigox::utils::ToLower ( const std::string &  s)

Convert a string to lower case.

Parameters
sthe string to convert.
Returns
the lower case version of s.

◆ ToUpper()

std::string indigox::utils::ToUpper ( const std::string &  s)

Convert a string to upper case.

Parameters
sthe string to convert.
Returns
the uppercase version of s.

◆ ToUpperFirst()

std::string indigox::utils::ToUpperFirst ( const std::string &  s)

Convert a string to lower case with a single leading upper case.

Acts on the string as a whole, ignoring any white space.

Parameters
sthe string the convert.
Returns
the lower case version of s with a leading upper case letter.

◆ WeakContainsShared()

__Iter indigox::utils::WeakContainsShared ( __Iter  b,
__Iter  e,
std::shared_ptr< T >  x 
)
inline

Check if a given shared_ptr<T> is in a weak_ptr<T> container.

Checks all weak_ptr<T> instances in the iterator range to see if the reference the supplied shared_ptr<T>. If the supplied shared_ptr<T> is empty, no comparisons are made.

Template Parameters
Tthe element_type.
__Iterthe iterator type.
Parameters
b,estart and end of the iterator range.
xthe shared_ptr<T> instance to search for.
Returns
the iterator position of the first found element.