get_code for TaggedValue

master
Daniel Kolesa 2016-07-30 21:42:49 +01:00
parent 364ca98e54
commit 6922853d66
2 changed files with 7 additions and 0 deletions

View File

@ -570,6 +570,12 @@ float Ident::get_float() const {
return cs_get_float(val, get_valtype());
}
ostd::Uint32 *TaggedValue::get_code() const {
if (get_type() != VAL_CODE)
return nullptr;
return const_cast<ostd::Uint32 *>(code);
}
static inline ostd::String cs_get_str(IdentValue const &v, int type, int len) {
switch (type) {
case VAL_STR:

View File

@ -127,6 +127,7 @@ struct OSTD_EXPORT TaggedValue: IdentValue {
ostd::String get_str() const;
int get_int() const;
float get_float() const;
ostd::Uint32 *get_code() const;
void get_val(TaggedValue &r) const;
void force_null();