Lexically casts an argument to an int64 if it is defined. Returns true if not null.
| 1003 | |
| 1004 | /// Lexically casts an argument to an int64 if it is defined. Returns true if not null. |
| 1005 | bool arg_as_OpcodeClassID( |
| 1006 | library::OpcodeClassID &opcode_class, |
| 1007 | KernelArgument::Value const *value_ptr) { |
| 1008 | |
| 1009 | if (value_ptr->not_null) { |
| 1010 | if (value_ptr->argument->description->type == ArgumentTypeID::kEnumerated) { |
| 1011 | |
| 1012 | opcode_class = library::from_string<library::OpcodeClassID>( |
| 1013 | static_cast<EnumeratedTypeArgument::EnumeratedTypeValue const *>(value_ptr)->element); |
| 1014 | |
| 1015 | if (opcode_class == library::OpcodeClassID::kInvalid) { |
| 1016 | throw std::runtime_error( |
| 1017 | "arg_as_OpcodeClassID() - illegal cast."); |
| 1018 | } |
| 1019 | } |
| 1020 | else { |
| 1021 | |
| 1022 | throw std::runtime_error( |
| 1023 | "arg_as_OpcodeClassID() - illegal cast."); |
| 1024 | } |
| 1025 | return true; |
| 1026 | } |
| 1027 | return false; |
| 1028 | } |
| 1029 | |
| 1030 | /// Lexically casts an argument to an int64 if it is defined. Returns true if not null. |
| 1031 | bool arg_as_OpcodeClassID( |
nothing calls this directly
no test coverage detected