MCPcopy Create free account
hub / github.com/GPUOpen-Tools/radeon_gpu_analyzer / toLongNumber

Method toLongNumber

external/amdt_base_tools/src/gtString.cpp:1950–1972  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Name: gtString::toLongNumber Description: Converts a string that contains an integer number into a long. Arguments: longNumber - Will get the output long. Return Val: bool - Success / failure. Author: AMD Developer Tools Team Date: 29/11/2004 -----------------------------------------------------------

Source from the content-addressed store, hash-verified

1948// Date: 29/11/2004
1949// ---------------------------------------------------------------------------
1950bool gtString::toLongNumber(long& longNumber) const
1951{
1952 bool retVal = false;
1953
1954 // Verify that this string represents an integer number
1955 if (isIntegerNumber())
1956 {
1957 // Remove the thousands separators from the string:
1958 gtString clone = *this;
1959 clone.removeChar(GT_THOUSANDS_SEPARATOR);
1960
1961 // Convert the string to an int:
1962#if AMDT_BUILD_TARGET == AMDT_WINDOWS_OS
1963 longNumber = _wtol(clone.asCharArray());
1964#else
1965 wchar_t* endPosition = nullptr;
1966 longNumber = wcstol(clone.asCharArray(), &endPosition, 10);
1967#endif
1968 retVal = true;
1969 }
1970
1971 return retVal;
1972}
1973
1974
1975// ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

asCharArrayMethod · 0.45

Tested by

no test coverage detected