Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct PkString : public std::string
- { //Wrapper to make std::string more friendly.
- operator bool (void) const { return !this->empty(); }
- operator const char * (void) const { return this->c_str(); }
- const char *operator+ (void) const { return this->c_str(); }
- char operator * (void) const { return *this->c_str(); }
- //We need these so we can still use our other overloads in expressions with temporaries.
- PkString operator+ (const PkString &Ref) const { return static_cast<const std::string&>(*this) + +Ref; }
- PkString operator+ (const char *In) const { return static_cast<const std::string&>(*this) + In; }
- PkString operator+ (char *In) const { return static_cast<const std::string&>(*this) + In; }
- PkString operator+ (const unsigned char*In)const { return static_cast<const std::string&>(*this) + (const char*)In; }
- PkString operator+ (const char Character) const { return static_cast<const std::string&>(*this) + Character; }
- PkString(const char *Stringy) : std::string(Stringy ? Stringy : "") {}
- PkString(const std::string &Stringy) : std::string(Stringy) {}
- PkString(void) : std::string() {}
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement