Get the type corresponding to a type name. \param s Name of type. \return Corresponding type enumeration value.
| 143 | /// \param s Name of type. |
| 144 | /// \return Corresponding type enumeration value. |
| 145 | inline Type type(std::string s) |
| 146 | { |
| 147 | s = Utils::tolower(s); |
| 148 | |
| 149 | if (s == "int8_t" || s == "int8" || s == "char") |
| 150 | return Type::Signed8; |
| 151 | if (s == "int16_t" || s == "int16" || s == "short") |
| 152 | return Type::Signed16; |
| 153 | if (s == "int32_t" || s == "int32" || s == "int") |
| 154 | return Type::Signed32; |
| 155 | if (s == "int64_t" || s == "int64" || s == "long") |
| 156 | return Type::Signed64; |
| 157 | if (s == "uint8_t" || s == "uint8" || s == "uchar") |
| 158 | return Type::Unsigned8; |
| 159 | if (s == "uint16_t" || s == "uint16" || s == "ushort") |
| 160 | return Type::Unsigned16; |
| 161 | if (s == "uint32_t" || s == "uint32" || s == "uint") |
| 162 | return Type::Unsigned32; |
| 163 | if (s == "uint64_t" || s == "uint64" || s == "ulong") |
| 164 | return Type::Unsigned64; |
| 165 | if (s == "float" || s == "float32") |
| 166 | return Type::Float; |
| 167 | if (s == "double" || s == "float64") |
| 168 | return Type::Double; |
| 169 | return Type::None; |
| 170 | } |
| 171 | |
| 172 | inline Type type(const std::string& baseType, size_t size) |
| 173 | { |