Biorbd Release_1.13.0
Loading...
Searching...
No Matches
String.h
1#ifndef BIORBD_UTILS_STRING_H
2#define BIORBD_UTILS_STRING_H
3
4#include "biorbdConfig.h"
5
6#include <iostream>
7
8namespace BIORBD_NAMESPACE {
9namespace utils {
13#ifdef SWIG
14class BIORBD_API String
15#else
16class BIORBD_API String : public std::string
17#endif
18{
19 public:
23 String();
24
29 String(const char* text);
30
35 String(const String& text);
36
41 String(const std::basic_string<char>& text);
42
43#ifndef SWIG
49 String& operator=(const String& other);
50#endif
51
57 String operator+(size_t val);
58
64 String operator+(int val);
65
71 String operator+(double val);
72
78 String operator+(const char* text);
79
85 String operator()(size_t idx) const;
86
93 String operator()(size_t startIdx, size_t lastIdx) const;
94
98 virtual ~String();
99
100#ifndef SWIG
106 static String tolower(const String& str);
107
112 String tolower() const;
113
119 static String toupper(const String& str);
120
125 String toupper() const;
126#endif
127
134 static String to_string(double val);
135
142 static String to_string(float val);
143
152 static String removeTrailing(const String& origin, const String& trailTag);
153};
154
155} // namespace utils
156} // namespace BIORBD_NAMESPACE
157
158#ifndef SWIG
164std::ostream& operator<<(
165 std::ostream& os,
167#endif
168
169#endif // BIORBD_UTILS_STRING_H
Wrapper around the std::string class with augmented functionality.
Definition String.h:18
static String removeTrailing(const String &origin, const String &trailTag)
The trailing tags of a string.
Definition String.cpp:106
static String tolower(const String &str)
Convert a string to a lower case string.
Definition String.cpp:76
static String toupper(const String &str)
Convert a string to a upper case string.
Definition String.cpp:84
String & operator=(const String &other)
Allow to use operator=.
Definition String.cpp:22
String()
Construct string.
Definition String.cpp:13
String operator+(size_t val)
Append an unsigned int to the string.
Definition String.cpp:41
static String to_string(double val)
Overload of the to_string C++11 function to allow for X-digits precision.
Definition String.cpp:92
String operator()(size_t idx) const
Get a specific character in the string.
Definition String.cpp:49