}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
render << "(" << type_name(type) << ")" << value->get_integer();
out << "readDouble(" << name << ");";
break;
default:
- throw "compiler error: no C++ reader for base type " + tbase + name;
+ throw "compiler error: no C++ reader for base type " + t_base_type::t_base_name(tbase) + name;
}
out <<
endl;
out << "writeDouble(" << name << ");";
break;
default:
- throw "compiler error: no C++ writer for base type " + tbase + name;
+ throw "compiler error: no C++ writer for base type " + t_base_type::t_base_name(tbase) + name;
}
} else if (type->is_enum()) {
out << "writeI32((int32_t)" << name << ");";
case t_base_type::TYPE_DOUBLE:
return "double";
default:
- throw "compiler error: no C++ base type name for base type " + tbase;
+ throw "compiler error: no C++ base type name for base type " + t_base_type::t_base_name(tbase);
}
}
result += " = (double)0";
break;
default:
- throw "compiler error: no C++ initializer for base type " + tbase;
+ throw "compiler error: no C++ initializer for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
result += " = (" + type_name(type) + ")0";
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
indent(out) << value->get_integer();
out << "readDouble";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "readI32";
out << "writeDouble, " << name << "),";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "writeI32, " << name << "),";
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
t_enum* tenum = (t_enum*)type;
out << "readDouble";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
out << " iprot";
} else if (type->is_enum()) {
out << "writeDouble oprot " << name;
break;
default:
- throw "compiler error: no hs name for base type " + tbase;
+ throw "compiler error: no hs name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
render << value->get_integer();
out << "readDouble();";
break;
default:
- throw "compiler error: no Java name for base type " + tbase;
+ throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "readI32();";
out << "writeDouble(" << name << ");";
break;
default:
- throw "compiler error: no Java name for base type " + tbase;
+ throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "writeI32(" << name << ");";
case t_base_type::TYPE_DOUBLE:
return (in_container ? "Double" : "double");
default:
- throw "compiler error: no C++ name for base type " + tbase;
+ throw "compiler error: no C++ name for base type " + t_base_type::t_base_name(tbase);
}
}
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
t_enum* tenum = (t_enum*)type;
out << "readDouble";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
string ename = capitalize(type->get_name());
out << "writeDouble(" << name << ")";
break;
default:
- throw "compiler error: no ocaml name for base type " + tbase;
+ throw "compiler error: no ocaml name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
string ename = capitalize(type->get_name());
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << value->get_integer();
out << "readDouble(\\$" << name << ");";
break;
default:
- throw "compiler error: no PERL name for base type " + tbase;
+ throw "compiler error: no PERL name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "readI32(\\$" << name << ");";
out << "writeDouble($" << name << ");";
break;
default:
- throw "compiler error: no PERL name for base type " + tbase;
+ throw "compiler error: no PERL name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "writeI32($" << name << ");";
result += " = 0.0";
break;
default:
- throw "compiler error: no PERL initializer for base type " + tbase;
+ throw "compiler error: no PERL initializer for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
result += " = 0";
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
indent(out) << value->get_integer();
indent() << "$" << name << " = $arr[1];" << endl;
break;
default:
- throw "compiler error: no PHP name for base type " + tbase + tfield->get_name();
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase) + tfield->get_name();
}
} else if (type->is_enum()) {
out <<
out << "readDouble($" << name << ");";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "readI32($" << name << ");";
indent() << "$output .= strrev(pack('d', $" << name << "));" << endl;
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out <<
out << "writeDouble($" << name << ");";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "writeI32($" << name << ");";
result += " = 0.0";
break;
default:
- throw "compiler error: no PHP initializer for base type " + tbase;
+ throw "compiler error: no PHP initializer for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
result += " = 0";
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
indent(out) << value->get_integer();
out << "readDouble();";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "readI32();";
out << "writeDouble(" << name << ")";
break;
default:
- throw "compiler error: no PHP name for base type " + tbase;
+ throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
out << "writeI32(" << name << ")";
}
break;
default:
- throw "compiler error: no const of base type " + tbase;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
}
} else if (type->is_enum()) {
indent(out) << value->get_integer();
case t_base_type::TYPE_DOUBLE:
return "decimal";
default:
- throw "compiler error: no C++ base type name for base type " + tbase;
+ throw "compiler error: no C++ base type name for base type " + t_base_type::t_base_name(tbase);
}
}
}
break;
default:
- throw "compiler error: no const of base type " + tbase + name;
+ throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase) + name;
}
} else if (type->is_enum()) {
if (value->get_type() != t_const_value::CV_INTEGER) {
}
virtual std::string get_fingerprint_material() const {
- switch (base_) {
- case TYPE_VOID : return "void"; break;
- case TYPE_STRING : return "string"; break;
- case TYPE_BOOL : return "bool"; break;
- case TYPE_BYTE : return "byte"; break;
- case TYPE_I16 : return "i16"; break;
- case TYPE_I32 : return "i32"; break;
- case TYPE_I64 : return "164"; break;
- case TYPE_DOUBLE : return "double"; break;
- default:
- throw "BUG: Can't get fingerprint material for this base type.";
+ std::string rv = t_base_name(base_);
+ if (rv == "(unknown)") {
+ throw "BUG: Can't get fingerprint material for this base type.";
+ }
+ return rv;
+ }
+
+ static std::string t_base_name(t_base tbase) {
+ switch (tbase) {
+ case TYPE_VOID : return "void"; break;
+ case TYPE_STRING : return "string"; break;
+ case TYPE_BOOL : return "bool"; break;
+ case TYPE_BYTE : return "byte"; break;
+ case TYPE_I16 : return "i16"; break;
+ case TYPE_I32 : return "i32"; break;
+ case TYPE_I64 : return "164"; break;
+ case TYPE_DOUBLE : return "double"; break;
+ default : return "(unknown)"; break;
}
}