* @brief wrapper on std::string * * Including results in 4000 lines of code * that must be included to build your header. This * class hides all of those details while maintaining * compatability with std::string. Using fc::string * instead of std::string can accelerate compile times * 10x. * * The implementation of this class is std::string, this header
| 68 | * std::string. |
| 69 | */ |
| 70 | class string { |
| 71 | public: |
| 72 | typedef char* iterator; |
| 73 | typedef const char* const_iterator; |
| 74 | enum { npos = size_t(-1) }; |
| 75 | // static const size_t npos;// = -1; |
| 76 | |
| 77 | string(); |
| 78 | string( const std::string& s ); |
| 79 | string( std::string&& s ); |
| 80 | string( const string& c ); |
| 81 | string( string&& c ); |
| 82 | string( const char* c ); |
| 83 | string( const char* c, int s ); |
| 84 | string( const_iterator b, const_iterator e ); |
| 85 | ~string(); |
| 86 | |
| 87 | operator std::string&(); |
| 88 | operator const std::string&()const; |
| 89 | |
| 90 | iterator begin(); |
| 91 | iterator end(); |
| 92 | |
| 93 | const_iterator begin()const; |
| 94 | const_iterator end()const; |
| 95 | |
| 96 | char& operator[](size_t idx); |
| 97 | const char& operator[](size_t idx)const; |
| 98 | |
| 99 | string& operator =( const string& c ); |
| 100 | string& operator =( string&& c ); |
| 101 | |
| 102 | void reserve( size_t ); |
| 103 | size_t size()const; |
| 104 | size_t find( char c, size_t pos = 0 )const; |
| 105 | size_t find(const fc::string& str, size_t pos = 0) const; |
| 106 | size_t find(const char* s, size_t pos = 0) const; |
| 107 | size_t rfind( char c, size_t pos = npos )const; |
| 108 | size_t rfind( const char* c, size_t pos = npos )const; |
| 109 | size_t rfind( const fc::string& c, size_t pos = npos )const; |
| 110 | size_t find_first_of (const fc::string& str, size_t pos = 0) const; |
| 111 | size_t find_first_of (const char* s, size_t pos = 0) const; |
| 112 | string& replace(size_t pos, size_t len, const fc::string& str); |
| 113 | string& replace(size_t pos, size_t len, const char* s); |
| 114 | |
| 115 | void resize( size_t s ); |
| 116 | void clear(); |
| 117 | |
| 118 | const char* c_str()const; |
| 119 | char* data(); |
| 120 | |
| 121 | bool operator == ( const char* s )const; |
| 122 | bool operator == ( const string& s )const; |
| 123 | bool operator != ( const string& s )const; |
| 124 | |
| 125 | friend bool operator < ( const string& a, const string& b ); |
| 126 | |
| 127 | string& operator+=( const string& s ); |
no outgoing calls