Lines Matching refs:pos
149 void string::Constructor(const value_type *str, size_type pos, size_type n)
154 memcpy(mData, str + pos, n);
186 string::string(const string& str, size_type pos, size_type n)
188 if (pos < str.mLength)
190 if (n > (str.mLength - pos)) {
191 n = str.mLength - pos;
193 Constructor(str.mData + pos , n);
201 string::string(const string& str, size_type pos)
203 if (pos < str.mLength)
205 Constructor(str.mData, pos, str.mLength - pos);
260 string& string::erase(size_type pos, size_type n)
262 if (pos >= mLength || 0 == n)
267 const size_t remainder = pos + n;
270 if (remainder >= mLength || remainder < pos)
272 *(mData + pos) = '\0';
273 mLength = pos;
279 value_type *d = mData + pos;
325 string& string::append(const value_type *str, size_type pos, size_type n)
329 Append(str + pos, n);
462 const char& string::operator[](const size_type pos) const
464 return mData[pos];
467 char& string::operator[](const size_type pos)
469 return mData[pos];
472 const char& string::at(const size_type pos) const
474 if (pos < mLength) {
475 return mData[pos];
482 char& string::at(const size_type pos)
484 if (pos < mLength) {
485 return mData[pos];
499 string& string::assign(const string& str, size_type pos, size_type n)
501 if (pos >= str.mLength)
502 { // pos is out of bound
505 if (n <= str.mLength - pos)
508 Constructor(str.mData, pos, n);
543 const size_type pos = base - mData;
552 base = mData + pos;
553 std::memmove(base + 1, base, mLength - pos);
567 string::size_type string::find(const value_type *str, size_type pos) const
580 return pos > mLength ? string::npos : pos;
583 if (mLength == 0 || pos > mLength - 1)
588 value_type *idx = std::strstr(mData + pos, str);
600 string string::substr(size_type pos, size_type n) const {
601 return string(*this, pos, n);
604 string::size_type string::find_first_of(value_type c, size_type pos) const {
605 if (pos >= mLength) {
610 res = static_cast<const char *>(std::memchr(mData + pos, c, mLength - pos));
614 string::size_type string::find_last_of(value_type c, size_type pos) const {
617 } else if (pos >= mLength) {
618 pos = mLength - 1; // >= 0
624 res = static_cast<const char *>(memrchr(mData, c, pos + 1));
628 string::size_type string::find_first_not_of(value_type c, size_type pos) const {
629 char *curr = mData + pos;
630 for (size_type i = pos; i < mLength; ++i, ++curr) {
638 string::size_type string::find_last_not_of(value_type c, size_type pos) const {
641 } else if (pos >= mLength) {
642 pos = mLength - 1; // >= 0
645 char *curr = mData + pos;
646 size_type i = pos;