Limbo
3.5.4
Toggle main menu visibility
Loading...
Searching...
No Matches
test
string
test_string.cpp
Go to the documentation of this file.
1
7
8
#include <iostream>
9
#include <string>
10
#include <
limbo/string/String.h
>
11
#include <
limbo/preprocessor/AssertMsg.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
limboAssertMsg
(
limbo::toupper
(s1) ==
"LIMBO2343SLIMBO"
,
"limbo::toupper failed"
);
25
limboAssertMsg
(
limbo::tolower
(s2) ==
"limbo2343slimbo"
,
"limbo::tolower failed"
);
26
limboAssertMsg
(
limbo::iequals
(s1, s2),
"limbo::iequals failed"
);
27
28
string
tmp;
29
tmp =
limbo::to_string
(
limbo::lowest<int>
());
30
cout << tmp <<
"("
<< tmp.size() <<
")"
<<
" == "
<<
limbo::lowest<int>
() << endl;
31
tmp =
limbo::to_string
(std::numeric_limits<int>::max());
32
cout << tmp <<
"("
<< tmp.size() <<
")"
<<
" == "
<< std::numeric_limits<int>::max() << endl;
33
tmp =
limbo::to_string
(
limbo::lowest<float>
());
34
cout << tmp <<
"("
<< tmp.size() <<
")"
<<
" == "
<<
limbo::lowest<float>
() << endl;
35
tmp =
limbo::to_string
(std::numeric_limits<float>::max());
36
cout << tmp <<
"("
<< tmp.size() <<
")"
<<
" == "
<< std::numeric_limits<float>::max() << endl;
37
38
return
0;
39
}
AssertMsg.h
assertion with message
limboAssertMsg
#define limboAssertMsg(condition, args...)
custom assertion with message
Definition
AssertMsg.h:24
Math.h
mathematical utilities such as abs
String.h
Check string is integer, floating point, number... Convert string to upper/lower cases.
limbo::to_string
string to_string(int val)
convert integer to string
Definition
ToString.h:24
limbo::toupper
string toupper(string const &s)
convert string to upper case
Definition
String.h:83
limbo::lowest< int >
int lowest< int >()
specialization for integer types
Definition
Math.h:121
limbo::lowest< float >
float lowest< float >()
specialization for floating point types
Definition
Math.h:157
limbo::lowest
T lowest()
generic function to get lowest value of numbers
limbo::iequals
bool iequals(string const &s1, string const &s2)
check two strings equal, case-insensitive
Definition
String.h:108
limbo::tolower
string tolower(string const &s)
convert string to lower case
Definition
String.h:95
main
int main()
main function
Definition
test_string.cpp:19
Generated on
for Limbo by
1.17.0