| 118 | |
| 119 | |
| 120 | _Use_decl_annotations_ |
| 121 | BOOL |
| 122 | StrUnsignedLongLongFromString( |
| 123 | const std::string& Token, |
| 124 | BOOLEAN IsHex, |
| 125 | PULONGLONG pValue |
| 126 | ) |
| 127 | { |
| 128 | int Base = IsHex ? 16 : 10; |
| 129 | ULONGLONG Value = 0; |
| 130 | BOOL status = TRUE; |
| 131 | |
| 132 | // |
| 133 | // Zero out parameters. |
| 134 | // |
| 135 | *pValue = 0; |
| 136 | |
| 137 | try |
| 138 | { |
| 139 | Value = std::stoull(Token, nullptr, Base); |
| 140 | } |
| 141 | catch (const std::exception&) |
| 142 | { |
| 143 | status = FALSE; |
| 144 | goto exit; |
| 145 | } |
| 146 | |
| 147 | // |
| 148 | // Set out parameters. |
| 149 | // |
| 150 | *pValue = Value; |
| 151 | |
| 152 | exit: |
| 153 | return status; |
| 154 | } |
| 155 | |
| 156 | |
| 157 | _Use_decl_annotations_ |
no outgoing calls
no test coverage detected