Logo Search packages:      
Sourcecode: osb-jscore version File versions  Download package

bool KJS::UString::is8Bit (  )  const

Use this if you want to make sure that this string is a plain ASCII string. For example, if you don't want to lose any information when using cstring() or ascii().

Returns:
True if the string doesn't contain any non-ASCII characters.

Definition at line 793 of file ustring.cpp.

References data(), size(), and KJS::UChar::uc.

Referenced by toDouble().

{
  const UChar *u = data();
  const UChar *limit = u + size();
  while (u < limit) {
    if (u->uc > 0xFF)
      return false;
    ++u;
  }

  return true;
}


Generated by  Doxygen 1.6.0   Back to index