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

unsigned long KJS::UString::toULong ( bool *  ok,
bool  tolerateEmptyString 
) const

Attempts an conversion to an unsigned long integer. ok will be set according to the success.

tolerateEmptyString if false, toULong will return false for *ok for an empty string.

Definition at line 892 of file ustring.cpp.

References toDouble().

  double d = toDouble(false, tolerateEmptyString);
  bool b = true;

  if (isNaN(d) || d != static_cast<unsigned long>(d)) {
    b = false;
    d = 0;

  if (ok)
    *ok = b;

  return static_cast<unsigned long>(d);

Generated by  Doxygen 1.6.0   Back to index