xbmc/xbmc — pull request #825 by Montellese (2012-03-29 11:54:49+00:00)
Title: CVariant: add conversions from string to int/uint/double/float

This was requested in a commit comment a few weeks ago (can't find it) to simplify converting values stored in a CVariant as a string into a number (int/uint/double/float).

To be able to perform reliable validity checking of the conversion, the logic is to first get rid of all the whitespaces at the end of string (so that the end pointer doesn't point to one of those) and then doing the respective conversion with strtoX and checking whether the end pointer is null. If it's not the string does not, represent a single number and therefore cannot dynamically be converted to a number.