Wrappers of STL for convenient functions. More...
#include <list>#include <map>#include <set>#include <vector>#include <string>#include <algorithm>

Go to the source code of this file.
Functions | |
| template<class V > | |
| void | uAppend (std::list< V > &list, const std::list< V > &newItems) |
| template<class V > | |
| bool | uContains (const std::list< V > &list, const V &value) |
| template<class K , class V > | |
| bool | uContains (const std::map< K, V > &map, const K &key) |
| template<class K , class V > | |
| bool | uContains (const std::multimap< K, V > &map, const K &key) |
| template<class V > | |
| int | uIndexOf (const std::vector< V > &list, const V &value) |
| template<class K , class V > | |
| void | uInsert (std::map< K, V > &map, const std::pair< K, V > &pair) |
| bool | uIsDigit (const char c) |
| template<class V > | |
| std::list< V >::iterator | uIteratorAt (std::list< V > &list, const unsigned int &pos) |
| template<class V > | |
| std::list< V >::const_iterator | uIteratorAt (const std::list< V > &list, const unsigned int &pos) |
| template<class V > | |
| std::set< V >::iterator | uIteratorAt (std::set< V > &set, const unsigned int &pos) |
| template<class V > | |
| std::set< V >::const_iterator | uIteratorAt (const std::set< V > &set, const unsigned int &pos) |
| template<class V > | |
| std::vector< V >::iterator | uIteratorAt (std::vector< V > &v, const unsigned int &pos) |
| template<class V > | |
| std::vector< V >::const_iterator | uIteratorAt (const std::vector< V > &v, const unsigned int &pos) |
| template<class K , class V > | |
| std::vector< K > | uKeys (const std::multimap< K, V > &mm) |
| template<class K , class V > | |
| std::vector< K > | uKeys (const std::map< K, V > &m) |
| template<class K , class V > | |
| std::list< K > | uKeysList (const std::multimap< K, V > &mm) |
| template<class K , class V > | |
| std::list< K > | uKeysList (const std::map< K, V > &m) |
| template<class K , class V > | |
| std::set< K > | uKeysSet (const std::map< K, V > &m) |
| template<class V > | |
| std::vector< V > | uListToVector (const std::list< V > &list) |
| std::list< std::string > | uSplit (const std::string &str, char separator= ' ') |
| std::list< std::string > | uSplitNumChar (const std::string &str) |
| bool | uStrContains (const std::string &string, const std::string &substring) |
| int | uStrNumCmp (const std::string &a, const std::string &b) |
| template<class K , class V > | |
| V | uTake (std::map< K, V > &m, const K &key, const V &defaultValue=V()) |
| template<class K , class V > | |
| std::list< K > | uUniqueKeys (const std::multimap< K, V > &mm) |
| template<class K , class V > | |
| V | uValue (const std::map< K, V > &m, const K &key, const V &defaultValue=V()) |
| template<class V > | |
| V & | uValueAt (std::list< V > &list, const unsigned int &pos) |
| template<class V > | |
| const V & | uValueAt (const std::list< V > &list, const unsigned int &pos) |
| template<class K , class V > | |
| std::vector< V > | uValues (const std::multimap< K, V > &mm) |
| template<class K , class V > | |
| std::list< V > | uValues (const std::multimap< K, V > &mm, const K &key) |
| template<class K , class V > | |
| std::vector< V > | uValues (const std::map< K, V > &m) |
| template<class K , class V > | |
| std::list< V > | uValuesList (const std::multimap< K, V > &mm) |
| template<class K , class V > | |
| std::list< V > | uValuesList (const std::map< K, V > &m) |
| template<class V > | |
| std::list< V > | uVectorToList (const std::vector< V > &v) |
Wrappers of STL for convenient functions.
All functions you will find here are here for the use of STL in a more convenient way.
Definition in file UStl.h.
| void uAppend | ( | std::list< V > & | list, |
| const std::list< V > & | newItems | ||
| ) | [inline] |
| bool uContains | ( | const std::list< V > & | list, |
| const V & | value | ||
| ) | [inline] |
| bool uContains | ( | const std::map< K, V > & | map, |
| const K & | key | ||
| ) | [inline] |
| bool uContains | ( | const std::multimap< K, V > & | map, |
| const K & | key | ||
| ) | [inline] |
| int uIndexOf | ( | const std::vector< V > & | list, |
| const V & | value | ||
| ) | [inline] |
| void uInsert | ( | std::map< K, V > & | map, |
| const std::pair< K, V > & | pair | ||
| ) | [inline] |
| bool uIsDigit | ( | const char | c | ) | [inline] |
| std::list<V>::iterator uIteratorAt | ( | std::list< V > & | list, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::list<V>::const_iterator uIteratorAt | ( | const std::list< V > & | list, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::set<V>::iterator uIteratorAt | ( | std::set< V > & | set, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::set<V>::const_iterator uIteratorAt | ( | const std::set< V > & | set, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::vector<V>::iterator uIteratorAt | ( | std::vector< V > & | v, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::vector<V>::const_iterator uIteratorAt | ( | const std::vector< V > & | v, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::vector<K> uKeys | ( | const std::multimap< K, V > & | mm | ) | [inline] |
| std::vector<K> uKeys | ( | const std::map< K, V > & | m | ) | [inline] |
| std::list<K> uKeysList | ( | const std::multimap< K, V > & | mm | ) | [inline] |
| std::list<K> uKeysList | ( | const std::map< K, V > & | m | ) | [inline] |
| std::set<K> uKeysSet | ( | const std::map< K, V > & | m | ) | [inline] |
| std::vector<V> uListToVector | ( | const std::list< V > & | list | ) | [inline] |
| std::list<std::string> uSplit | ( | const std::string & | str, |
| char | separator = ' ' |
||
| ) | [inline] |
Split a string into multiple string around the specified separator. Example:
std::list<std::string> v = split("Hello the world!", ' ');
The list v will contain {"Hello", "the", "world!"}
| str | the string |
| separator | the separator character |
| std::list<std::string> uSplitNumChar | ( | const std::string & | str | ) | [inline] |
| bool uStrContains | ( | const std::string & | string, |
| const std::string & | substring | ||
| ) | [inline] |
| int uStrNumCmp | ( | const std::string & | a, |
| const std::string & | b | ||
| ) | [inline] |
Compare two alphanumeric strings. Useful to sort filenames (human-like sorting). Example:
std::string a = "Image9.jpg"; std::string b = "Image10.jpg"; int r = uStrNumCmp(a, b); // r returns -1 (a is smaller than b). In contrast, std::strcmp(a, b) would return 1.
| a | the first string |
| b | the second string |
| V uTake | ( | std::map< K, V > & | m, |
| const K & | key, | ||
| const V & | defaultValue = V() |
||
| ) | [inline] |
| std::list<K> uUniqueKeys | ( | const std::multimap< K, V > & | mm | ) | [inline] |
| V uValue | ( | const std::map< K, V > & | m, |
| const K & | key, | ||
| const V & | defaultValue = V() |
||
| ) | [inline] |
| V& uValueAt | ( | std::list< V > & | list, |
| const unsigned int & | pos | ||
| ) | [inline] |
| const V& uValueAt | ( | const std::list< V > & | list, |
| const unsigned int & | pos | ||
| ) | [inline] |
| std::vector<V> uValues | ( | const std::multimap< K, V > & | mm | ) | [inline] |
| std::list<V> uValues | ( | const std::multimap< K, V > & | mm, |
| const K & | key | ||
| ) | [inline] |
| std::vector<V> uValues | ( | const std::map< K, V > & | m | ) | [inline] |
| std::list<V> uValuesList | ( | const std::multimap< K, V > & | mm | ) | [inline] |
| std::list<V> uValuesList | ( | const std::map< K, V > & | m | ) | [inline] |
| std::list<V> uVectorToList | ( | const std::vector< V > & | v | ) | [inline] |