mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
std::string conversion operator for my string.
This commit is contained in:
parent
2079d5bd6e
commit
ad4e3bec3c
@ -433,7 +433,7 @@ uint32_t String::to_uint() {
|
||||
return static_cast<uint32_t>(atoll(c_str()));
|
||||
}
|
||||
|
||||
std::string String::to_string() {
|
||||
std::string String::to_string() const {
|
||||
return std::string(c_str());
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
double to_double();
|
||||
int to_int();
|
||||
uint32_t to_uint();
|
||||
std::string to_string();
|
||||
std::string to_string() const;
|
||||
|
||||
char *c_str();
|
||||
const char *c_str() const;
|
||||
@ -94,6 +94,9 @@ public:
|
||||
friend bool operator==(std::string &b, const String &a);
|
||||
friend bool operator!=(std::string &b, const String &a);
|
||||
|
||||
operator std::string() { return to_string(); }
|
||||
operator std::string() const { return to_string(); }
|
||||
|
||||
String();
|
||||
String(const String &other);
|
||||
String(const String &other, const int grow_by);
|
||||
|
Loading…
Reference in New Issue
Block a user