|
esphome-api-client 0.5.0
Modern C++17 client for the ESPHome native API (plaintext + Noise)
|
Classes | |
| struct | ProtoEnum |
| struct | ProtoEnumValue |
| struct | ProtoField |
| struct | ProtoFile |
| struct | ProtoMessageDef |
| struct | Token |
Enumerations | |
| enum class | TokKind { Identifier , Number , String , Symbol , End } |
| enum class | FieldType { Double , Float , Int32 , Int64 , Uint32 , Uint64 , Sint32 , Sint64 , Fixed32 , Fixed64 , Sfixed32 , Sfixed64 , Bool , String , Bytes , Enum , Message } |
Functions | |
| std::string | cpp_ident (const std::string &name) |
| std::string | cpp_element_type (const ProtoField &f) |
| void | emit_enums (const ProtoFile &file, const std::string &out_dir) |
| void | emit_messages (const ProtoFile &file, const std::string &include_dir, const std::string &src_dir) |
| void | emit_registry (const ProtoFile &file, const std::string &include_dir, const std::string &src_dir) |
| std::vector< Token > | lex (const std::string &src, const std::string &filename) |
| Tokenize proto source. Throws std::runtime_error on a lexical error. | |
| bool | is_scalar_type (const std::string &t) |
| True for the 15 proto3 scalar keywords. | |
| int | wire_type_of (const ProtoField &f) |
| Wire type number (0/1/2/5) for a resolved field. | |
| bool | is_packed (const ProtoField &f) |
| True if a repeated field of this type is packed (honoring explicit flag). | |
| void | parse_into (const std::vector< Token > &tokens, const std::string &filename, ProtoFile &file) |
Parse one proto file's tokens, appending its enums/messages to file. | |
| void | resolve_types (ProtoFile &file) |
| Resolve every field's type_name to FieldType::Enum / FieldType::Message (or a scalar). | |
|
strong |
|
strong |
| std::string protogen::cpp_element_type | ( | const ProtoField & | f | ) |
| std::string protogen::cpp_ident | ( | const std::string & | name | ) |
| void protogen::emit_enums | ( | const ProtoFile & | file, |
| const std::string & | out_dir | ||
| ) |
| void protogen::emit_messages | ( | const ProtoFile & | file, |
| const std::string & | include_dir, | ||
| const std::string & | src_dir | ||
| ) |
| void protogen::emit_registry | ( | const ProtoFile & | file, |
| const std::string & | include_dir, | ||
| const std::string & | src_dir | ||
| ) |
| bool protogen::is_packed | ( | const ProtoField & | f | ) |
True if a repeated field of this type is packed (honoring explicit flag).
| bool protogen::is_scalar_type | ( | const std::string & | t | ) |
True for the 15 proto3 scalar keywords.
| std::vector< Token > protogen::lex | ( | const std::string & | src, |
| const std::string & | filename | ||
| ) |
Tokenize proto source. Throws std::runtime_error on a lexical error.
| void protogen::parse_into | ( | const std::vector< Token > & | tokens, |
| const std::string & | filename, | ||
| ProtoFile & | file | ||
| ) |
Parse one proto file's tokens, appending its enums/messages to file.
Throws std::runtime_error on any unsupported construct.
| void protogen::resolve_types | ( | ProtoFile & | file | ) |
Resolve every field's type_name to FieldType::Enum / FieldType::Message (or a scalar).
Throws if a type name is unknown.
| int protogen::wire_type_of | ( | const ProtoField & | f | ) |
Wire type number (0/1/2/5) for a resolved field.