diff options
author | EdB <[email protected]> | 2015-04-24 12:59:55 +0200 |
---|---|---|
committer | Tom Stellard <[email protected]> | 2015-04-29 12:45:00 +0000 |
commit | 5ca9b23319db66d9768d46c0a7504b7bb079164a (patch) | |
tree | 731afaa27d31d53749bb25553ae26aab6a0cc65f /src/gallium/state_trackers/clover/util | |
parent | 1b4a1d0049646e574565bab38b8ae935c1c45fae (diff) |
clover: remove compat::string
Acked-by: Francisco Jerez <[email protected]>
Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/util')
-rw-r--r-- | src/gallium/state_trackers/clover/util/compat.hpp | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/src/gallium/state_trackers/clover/util/compat.hpp b/src/gallium/state_trackers/clover/util/compat.hpp index ea7d3a000be..dc063344c3c 100644 --- a/src/gallium/state_trackers/clover/util/compat.hpp +++ b/src/gallium/state_trackers/clover/util/compat.hpp @@ -307,110 +307,6 @@ namespace clover { size_t offset; }; - class string { - public: - typedef char *iterator; - typedef const char *const_iterator; - typedef char value_type; - typedef char &reference; - typedef const char &const_reference; - typedef std::ptrdiff_t difference_type; - typedef std::size_t size_type; - - string() : v() { - } - - string(const char *p) : v(p, std::strlen(p)) { - } - - template<typename C> - string(const C &v) : v(v) { - } - - operator std::string() const { - return std::string(v.begin(), v.end()); - } - - bool - operator==(const string &s) const { - return this->v == s.v; - } - - void - reserve(size_type n) { - v.reserve(n); - } - - void - resize(size_type n, char x = char()) { - v.resize(n, x); - } - - void - push_back(char x) { - v.push_back(x); - } - - size_type - size() const { - return v.size(); - } - - size_type - capacity() const { - return v.capacity(); - } - - iterator - begin() { - return v.begin(); - } - - const_iterator - begin() const { - return v.begin(); - } - - iterator - end() { - return v.end(); - } - - const_iterator - end() const { - return v.end(); - } - - reference - operator[](size_type i) { - return v[i]; - } - - const_reference - operator[](size_type i) const { - return v[i]; - } - - const char * - c_str() const { - v.reserve(size() + 1); - *v.end() = 0; - return v.begin(); - } - - const char * - find(const string &s) const { - for (size_t i = 0; i + s.size() < size(); ++i) { - if (!std::memcmp(begin() + i, s.begin(), s.size())) - return begin() + i; - } - - return end(); - } - - private: - mutable vector<char> v; - }; } } |