static int shift = 'A' - 'a';
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
if(*it >= 'a' && *it <= 'z')
s.d->data.push_back(*it + shift);
else
ByteVector v(size(), 0);
char *p = v.data();
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it)
+ for(ConstIterator it = begin(); it != end(); ++it)
*p++ = static_cast<char>(*it);
return v;
*p++ = '\xff';
*p++ = '\xfe';
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
*p++ = static_cast<char>(*it & 0xff);
*p++ = static_cast<char>(*it >> 8);
}
ByteVector v(size() * 2, 0);
char *p = v.data();
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
*p++ = static_cast<char>(*it >> 8);
*p++ = static_cast<char>(*it & 0xff);
}
ByteVector v(size() * 2, 0);
char *p = v.data();
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
*p++ = static_cast<char>(*it & 0xff);
*p++ = static_cast<char>(*it >> 8);
}
bool String::isLatin1() const
{
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
if(*it >= 256)
return false;
}
bool String::isAscii() const
{
- for(wstring::const_iterator it = d->data.begin(); it != d->data.end(); ++it) {
+ for(ConstIterator it = begin(); it != end(); ++it) {
if(*it >= 128)
return false;
}