mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-13 06:29:47 -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 CharT* iterator;
|
||||||
typedef const CharT* const_iterator;
|
typedef const CharT* const_iterator;
|
||||||
|
|
||||||
|
static constexpr const size_t npos = -1;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t _size;
|
size_t _size;
|
||||||
size_t _capacity;
|
size_t _capacity;
|
||||||
@ -227,6 +229,16 @@ public:
|
|||||||
return _data[i];
|
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
|
//Operators
|
||||||
|
|
||||||
bool operator==(const CharT* s) const {
|
bool operator==(const CharT* s) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user