MCPcopy Create free account
hub / github.com/HelenOS/helenos / stoul

Function stoul

uspace/lib/cpp/src/string.cpp:57–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 }
56
57 unsigned long stoul(const string& str, size_t* idx, int base)
58 {
59 char* end;
60 unsigned long result = ::strtoul(str.c_str(), &end, base);
61
62 if (end != str.c_str())
63 {
64 if (idx)
65 *idx = static_cast<size_t>(end - str.c_str());
66 return result;
67 }
68 // TODO: no conversion -> invalid_argument
69 // TODO: ERANGE in errno -> out_of_range
70 return 0;
71 }
72
73 long long stoll(const string& str, size_t* idx, int base)
74 {

Callers

nothing calls this directly

Calls 2

strtoulFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected