Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
test_string.cpp
Go to the documentation of this file.
1 
8 #include <iostream>
9 #include <string>
10 #include <limbo/string/String.h>
12 #include <limbo/math/Math.h>
13 using std::cout;
14 using std::endl;
15 using std::string;
16 
19 int main()
20 {
21  string s1 = "limbo2343slimbo";
22  string s2 = "LiMbo2343SliMbo";
23 
24  assert_msg(limbo::toupper(s1) == "LIMBO2343SLIMBO", "limbo::toupper failed");
25  assert_msg(limbo::tolower(s2) == "limbo2343slimbo", "limbo::tolower failed");
26  assert_msg(limbo::iequals(s1, s2), "limbo::iequals failed");
27 
28  string tmp;
30  cout << tmp << "(" << tmp.size() << ")" << " == " << limbo::lowest<int>() << endl;
32  cout << tmp << "(" << tmp.size() << ")" << " == " << std::numeric_limits<int>::max() << endl;
34  cout << tmp << "(" << tmp.size() << ")" << " == " << limbo::lowest<float>() << endl;
36  cout << tmp << "(" << tmp.size() << ")" << " == " << std::numeric_limits<float>::max() << endl;
37 
38  return 0;
39 }
int lowest< int >()
specialization for integer types
Definition: Math.h:121
string toupper(string const &s)
convert string to upper case
Definition: String.h:83
string to_string(int val)
convert integer to string
Definition: ToString.h:24
assertion with message
mathematical utilities such as abs
int main()
main function
Definition: test_string.cpp:19
bool iequals(string const &s1, string const &s2)
check two strings equal, case-insensitive
Definition: String.h:108
std::iterator_traits< Iterator >::value_type max(Iterator first, Iterator last)
get max of an array
Definition: Math.h:61
Check string is integer, floating point, number... Convert string to upper/lower cases.
float lowest< float >()
specialization for floating point types
Definition: Math.h:157
string tolower(string const &s)
convert string to lower case
Definition: String.h:95
#define assert_msg(condition, message)
assertion with message
Definition: AssertMsg.h:34