MCPcopy Create free account
hub / github.com/columbia/egalito / getAddress

Method getAddress

app/shell2/command.cpp:142–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 if(*str != 0 && end && *end == 0) return value; \
141 } while(0)
142address_t ArgumentValue::getAddress() const {
143 switch(type) {
144 case ArgumentSpec::TYPE_ADDRESS:
145 case ArgumentSpec::TYPE_HEX: {
146 /*const char *str = data.c_str();
147 char *end = nullptr;
148 address_t address = std::strtoul(str, &end, 16);
149 if(*str != 0 && *end == 0) return address;*/
150 STR_TO_INT(data, std::strtoul, 16);
151 throw std::string("Invalid argument, ") + ArgumentSpec::getExpectedMessage(type);
152 }
153 default:
154 throw "Calling ArgumentValue::getAddress() on unexpected argument type";
155 }
156}
157
158long ArgumentValue::getNumber() const {
159 switch(type) {

Callers 1

registerCommandsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected