mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 22:17:11 -04:00
Add find support to std::string
This commit is contained in:
parent
6448a699fc
commit
a3bb9c5a41
@ -28,6 +28,8 @@ public:
|
||||
typedef CharT* iterator;
|
||||
typedef const CharT* const_iterator;
|
||||
|
||||
static constexpr const size_t npos = -1;
|
||||
|
||||
private:
|
||||
size_t _size;
|
||||
size_t _capacity;
|
||||
@ -227,6 +229,16 @@ public:
|
||||
return _data[i];
|
||||
}
|
||||
|
||||
size_t find(char c) const {
|
||||
for(size_t i = 0; i < size(); ++i){
|
||||
if(_data[i] == c){
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
//Operators
|
||||
|
||||
bool operator==(const CharT* s) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user