MCPcopy Create free account
hub / github.com/changeofpace/VivienneVMM / StrUnsignedLongFromString

Function StrUnsignedLongFromString

VivienneCL/string_util.cpp:83–117  ·  view source on GitHub ↗

============================================================================= From String Interface =============================================================================

Source from the content-addressed store, hash-verified

81// From String Interface
82//=============================================================================
83_Use_decl_annotations_
84BOOL
85StrUnsignedLongFromString(
86 const std::string& Token,
87 BOOLEAN IsHex,
88 PULONG pValue
89)
90{
91 int Base = IsHex ? 16 : 10;
92 ULONG Value = 0;
93 BOOL status = TRUE;
94
95 //
96 // Zero out parameters.
97 //
98 *pValue = 0;
99
100 try
101 {
102 Value = std::stoul(Token, nullptr, Base);
103 }
104 catch (const std::exception&)
105 {
106 status = FALSE;
107 goto exit;
108 }
109
110 //
111 // Set out parameters.
112 //
113 *pValue = Value;
114
115exit:
116 return status;
117}
118
119
120_Use_decl_annotations_

Callers 4

ParseUnsignedLongTokenFunction · 0.85
ParseScaleFactorTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected