Closed Bug 376262 Opened 17 years ago Closed 11 years ago

Consider adding a ParseDouble method to nsAString

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: jwatt, Unassigned)

Details

Could we add a ParseDouble method to nsAString with a signature something like the following. I'm wondering if mStart or mEnd should be iterators or indexes.

/**
 * ParseDouble - parses a double from the string.
 *
 * @param aStart  Index at which parsing should begin.
 * @param aEnd    Out param that (if non-null) is set to the index of the
 *                character at which parsing stops. If a double is not found,
 *                or an error occurs during parsing, aEnd will be set to aStart.
 * @param aStatus Out param used to indicate success or failure. It will be set
 *                to NS_OK if a double is successfully found and parsed from
 *                the string, or else a failure code.
 */
PRFloat64
nsAString::ParseDouble(index_type aStart = 0, index_type *aEnd = nsnull,
                       nsresult *aStatus = nsnull);
Component: XPCOM → String
QA Contact: xpcom → string
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INCOMPLETE
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.