* String::ToFooStrict()
|base| optional argument is rarely used.
It seems there are only one instance of ToUIntStrict(&ok, 16).
Introduce HexToUIntStrict(), and remove |base| arguments?
* String::ToFooStrict() and CharactersToFooStrict().
They skips leading and trailing spaces. We should check if we need such non-strict behavior.
* String::ToFoo() (not Strict)
ToInt() and ToUInt(): The number of usage is low. We might be able to replace them with Strict versions.
ToInt64() and ToUInt64(): They are not used. We should remove them.
* Returning a parsed value, and |ok| pointer argument
Returning |ok| value makes callsites simpler. ParseHTMLInteger() is designed so.
Current typical code:
bool ok;
unsigned value = string.ToUIntStrict(&ok);
if (!ok)
... error handling ...
foo(value);
Updated code:
unsigned value;
if (!string.ToUIntStrict(&value))
... error handling ...
foo(value);
Probably people have different opinion on this. We should discuss this somewhere.
Comment 1 by bugdroid1@chromium.org
, Jul 20 2017