23 #include <interfaces/generator/constant.h> 24 #include <interfaces/generator/type_checker.h> 25 #include <interfaces/generator/exceptions.h> 44 const std::string &value,
const std::string &comment)
55 if ( type ==
"string" ) {
56 this->value = std::string(
"\"") + value +
"\"";
60 this->comment = comment;
90 if (type ==
"string") {
92 }
else if (type ==
"byte") {
94 }
else if (type ==
"float" || type ==
"double" || type ==
"bool") {
std::string getName()
Get name of constant.
static bool validValue(const std::string &type, const std::string &value)
Check value validity for given type.
Thrown if illegal value is supplied.
std::string getType()
Get type of constant.
std::string getComment()
Get comment of constant.
std::string getValue()
Get value of constant.
static bool validType(const std::string &type, std::vector< InterfaceEnumConstant > *enum_constants=0)
Check type validity.
Thrown if illegal type is supplied.
InterfaceConstant(const std::string &name, const std::string &type, const std::string &value, const std::string &comment)
Constructor.