From f3d4611f137ed574ae705eec61c0ce80da8af806 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 18 Dec 2018 00:20:34 +0800 Subject: *string --- src/libjin/common/je_string.h | 67 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/libjin/common/je_string.h (limited to 'src') diff --git a/src/libjin/common/je_string.h b/src/libjin/common/je_string.h new file mode 100644 index 0000000..db0cffb --- /dev/null +++ b/src/libjin/common/je_string.h @@ -0,0 +1,67 @@ +#ifndef __JE_STRING_H__ +#define __JE_STRING_H__ + +#include + +namespace JinEngine +{ + + class String : public std::string + { + public: + inline String() + : std::string() + { + } + + inline String(const std::string& str) + : std::string(str) + { + } + + inline String(const String& str) + : std::string(str) + { + } + + inline String& operator = (const String& str) + { + std::string::operator=(str); + return *this; + } + + inline operator const char* () const + { + return this->c_str(); + } + + inline const char* str() const + { + return this->c_str(); + } + + inline String(const String& s2, size_type pos2, size_type len2) + : std::string(s2, pos2, len2) + { + } + + inline String(const char* nts) + : std::string(nts) + { + } + + inline String(const char* buf, size_type bufsize) + : std::string(buf, bufsize) + { + } + + inline String(size_type repetitions, char c) + : std::string(repetitions, c) + { + } + + }; + +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0