MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stoul

Function stoul

support/StringSupport.h:91–114  ·  view source on GitHub ↗

Convert string values to unsigned long. * * @note This function implements the same behaviour as std::stoul. The latter * is missing in some Android toolchains. * * @param[in] str String to be converted to unsigned long. * @param[in] pos If idx is not a null pointer, the function sets the value of pos to the position of the first character in str after the number. * @param[in] base

Source from the content-addressed store, hash-verified

89 * @return Unsigned long representation of @p str.
90 */
91inline unsigned long stoul(const std::string &str, std::size_t *pos = 0, NumericBase base = NumericBase::BASE_10)
92{
93 assert(base == NumericBase::BASE_10 || base == NumericBase::BASE_16);
94 std::stringstream stream;
95 unsigned long value = 0;
96 if (base == NumericBase::BASE_16)
97 {
98 stream << std::hex;
99 }
100 stream << str;
101 stream >> value;
102
103 if (pos)
104 {
105 std::string s;
106 std::stringstream ss_p;
107
108 ss_p << value;
109 ss_p >> s;
110 *pos = s.length();
111 }
112
113 return value;
114}
115
116#if defined(__ANDROID__) || defined(BARE_METAL)
117/** Convert integer and float values to string.

Callers 8

midr_from_cpuidFunction · 0.85
get_cpu_capacitiesFunction · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
parse_descrFunction · 0.85
parse_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected