MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / StdString

Class StdString

include/hx/StdString.h:8–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace hx
7{
8 class StdString : public std::string
9 {
10 public:
11 StdString() : std::string() { }
12 StdString(const char *inPtr) : std::string(inPtr) { }
13 StdString(const char *inPtr, int inLen) : std::string(inPtr, inLen) { }
14 StdString(const std::string &inS) : std::string(inS) { }
15 StdString(const StdString &inS) : std::string(inS) { }
16
17 #if (HXCPP_API_LEVEL>1)
18 StdString(const Dynamic &inS) : std::string(inS.mPtr ? inS.mPtr->toString().utf8_str() : "null") { }
19 StdString(const String &inS) : std::string(inS.utf8_str()) { }
20 String toString() const { return String(c_str(),size()).dup(); }
21 String toString() { return String(c_str(),size()).dup(); }
22 operator Dynamic() const { return const_cast<StdString*>(this)->toString(); }
23 #endif
24
25 inline const StdString &toStdString() const { return *this; }
26
27 };
28}
29
30#endif

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected