Lines Matching refs:text
22 write_enum(stringstream& text, const EnumDescriptorProto& enu, const string& indent) in write_enum() argument
25 text << indent << "// enum " << enu.name() << endl; in write_enum()
28 text << indent << "const int " in write_enum()
36 text << indent << "static const int _ENUM_" << name << "_COUNT = " << N << ";" << endl; in write_enum()
37 text << indent << "static const char* _ENUM_" << name << "_NAMES[" << N << "] = {" << endl; in write_enum()
39 … text << indent << INDENT << "\"" << stripPrefix(enu.value(i).name(), prefix) << "\"," << endl; in write_enum()
41 text << indent << "};" << endl; in write_enum()
42 text << indent << "static const int _ENUM_" << name << "_VALUES[" << N << "] = {" << endl; in write_enum()
44 text << indent << INDENT << make_constant_name(enu.value(i).name()) << "," << endl; in write_enum()
46 text << indent << "};" << endl; in write_enum()
49 text << endl; in write_enum()
53 write_field(stringstream& text, const FieldDescriptorProto& field, const string& indent) in write_field() argument
62 text << indent << "// " << optional_comment << repeated_comment << proto_type << ' ' in write_field()
65 text << indent << "const uint64_t " << make_constant_name(field.name()) << " = 0x"; in write_field()
67 ios::fmtflags fmt(text.flags()); in write_field()
68 text << setfill('0') << setw(16) << hex << get_field_id(field); in write_field()
69 text.flags(fmt); in write_field()
71 text << "LL;" << endl; in write_field()
73 text << endl; in write_field()
77 write_message(stringstream& text, const DescriptorProto& message, const string& indent) in write_message() argument
82 text << indent << "// message " << message.name() << endl; in write_message()
83 text << indent << "namespace " << message.name() << " {" << endl; in write_message()
88 write_enum(text, message.enum_type(i), indented); in write_message()
94 write_message(text, message.nested_type(i), indented); in write_message()
100 write_field(text, message.field(i), indented); in write_message()
105 text << indented << "static const int _FIELD_COUNT = " << N << ";" << endl; in write_message()
106 text << indented << "static const char* _FIELD_NAMES[" << N << "] = {" << endl; in write_message()
108 text << indented << INDENT << "\"" << message.field(i).name() << "\"," << endl; in write_message()
110 text << indented << "};" << endl; in write_message()
111 text << indented << "static const uint64_t _FIELD_IDS[" << N << "] = {" << endl; in write_message()
113 … text << indented << INDENT << make_constant_name(message.field(i).name()) << "," << endl; in write_message()
115 text << indented << "};" << endl << endl; in write_message()
118 text << indent << "} //" << message.name() << endl; in write_message()
119 text << endl; in write_message()
125 stringstream text; in write_header_file() local
127 text << "// Generated by protoc-gen-cppstream. DO NOT MODIFY." << endl; in write_header_file()
128 text << "// source: " << file_descriptor.name() << endl << endl; in write_header_file()
134 text << "#ifndef " << header << endl; in write_header_file()
135 text << "#define " << header << endl; in write_header_file()
136 text << endl; in write_header_file()
140 text << "namespace " << *it << " {" << endl; in write_header_file()
142 text << endl; in write_header_file()
147 write_enum(text, file_descriptor.enum_type(i), ""); in write_header_file()
152 write_message(text, file_descriptor.message_type(i), ""); in write_header_file()
156 text << "} // " << *it << endl; in write_header_file()
159 text << endl; in write_header_file()
160 text << "#endif // " << header << endl; in write_header_file()
164 file_response->set_content(text.str()); in write_header_file()