basic_string <charT, traits, Allocator>&
basic_string <charT, traits, Allocator>::
replace (size_type pos1, size_type n1,
- const basic_string& str, size_type pos2, size_type n2)
+ const basic_string& _str, size_type pos2, size_type n2)
{
- const size_t len2 = str.length ();
+ const size_t len2 = _str.length ();
if (pos1 == 0 && n1 >= length () && pos2 == 0 && n2 >= len2)
- return operator= (str);
+ return operator= (_str);
OUTOFRANGE (pos2 > len2);
if (n2 > len2 - pos2)
n2 = len2 - pos2;
- return replace (pos1, n1, str.data () + pos2, n2);
+ return replace (pos1, n1, _str.data () + pos2, n2);
}
template <class charT, class traits, class Allocator>
template <class charT, class traits, class Allocator>
int basic_string <charT, traits, Allocator>::
-compare (const basic_string& str, size_type pos, size_type n) const
+compare (const basic_string& _str, size_type pos, size_type n) const
{
OUTOFRANGE (pos > length ());
size_t rlen = length () - pos;
if (rlen > n)
rlen = n;
- if (rlen > str.length ())
- rlen = str.length ();
- int r = traits::compare (data () + pos, str.data (), rlen);
+ if (rlen > _str.length ())
+ rlen = _str.length ();
+ int r = traits::compare (data () + pos, _str.data (), rlen);
if (r != 0)
return r;
if (rlen == n)
return 0;
- return (length () - pos) - str.length ();
+ return (length () - pos) - _str.length ();
}
template <class charT, class traits, class Allocator>
{
if (is.ipfx1 ())
{
- _IO_size_t count = 0;
+ _IO_size_t _count = 0;
streambuf *sb = is.rdbuf ();
s.resize (0);
int ch = sb->sbumpc ();
if (ch == EOF)
{
- is.setstate (count == 0
+ is.setstate (_count == 0
? (ios::failbit|ios::eofbit)
: ios::eofbit);
break;
}
- ++count;
+ ++_count;
if (ch == delim)
break;
}
// We need to be friends with istream to do this.
- // is._gcount = count;
+ // is._gcount = _count;
is.isfx ();
return is;
}
explicit basic_string (): dat (nilRep.grab ()) { }
- basic_string (const basic_string& str): dat (str.rep ()->grab ()) { }
- basic_string (const basic_string& str, size_type pos, size_type n = npos)
- : dat (nilRep.grab ()) { assign (str, pos, n); }
+ basic_string (const basic_string& _str): dat (_str.rep ()->grab ()) { }
+ basic_string (const basic_string& _str, size_type pos, size_type n = npos)
+ : dat (nilRep.grab ()) { assign (_str, pos, n); }
basic_string (const charT* s, size_type n)
: dat (nilRep.grab ()) { assign (s, n); }
basic_string (const charT* s)
void swap (basic_string &s) { charT *d = dat; dat = s.dat; s.dat = d; }
- basic_string& append (const basic_string& str, size_type pos = 0,
+ basic_string& append (const basic_string& _str, size_type pos = 0,
size_type n = npos)
- { return replace (length (), 0, str, pos, n); }
+ { return replace (length (), 0, _str, pos, n); }
basic_string& append (const charT* s, size_type n)
{ return replace (length (), 0, s, n); }
basic_string& append (const charT* s)
size_type find (const basic_string& str, size_type pos = 0) const
{ return find (str.data(), pos, str.length()); }
size_type find (const charT* s, size_type pos, size_type n) const;
- size_type find (const charT* s, size_type pos = 0) const
- { return find (s, pos, traits::length (s)); }
+ size_type find (const charT* _s, size_type pos = 0) const
+ { return find (_s, pos, traits::length (_s)); }
size_type find (charT c, size_type pos = 0) const;
size_type rfind (const basic_string& str, size_type pos = npos) const
operator+ (const basic_string <charT, traits, Allocator>& lhs,
const basic_string <charT, traits, Allocator>& rhs)
{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
+ basic_string <charT, traits, Allocator> _str (lhs);
+ _str.append (rhs);
+ return _str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const charT* lhs, const basic_string <charT, traits, Allocator>& rhs)
{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
+ basic_string <charT, traits, Allocator> _str (lhs);
+ _str.append (rhs);
+ return _str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (charT lhs, const basic_string <charT, traits, Allocator>& rhs)
{
- basic_string <charT, traits, Allocator> str (1, lhs);
- str.append (rhs);
- return str;
+ basic_string <charT, traits, Allocator> _str (1, lhs);
+ _str.append (rhs);
+ return _str;
}
template <class charT, class traits, class Allocator>
inline basic_string <charT, traits, Allocator>
operator+ (const basic_string <charT, traits, Allocator>& lhs, const charT* rhs)
{
- basic_string <charT, traits, Allocator> str (lhs);
- str.append (rhs);
- return str;
+ basic_string <charT, traits, Allocator> _str (lhs);
+ _str.append (rhs);
+ return _str;
}
template <class charT, class traits, class Allocator>