| 974 | } |
| 975 | |
| 976 | void emitDebugString(const std::string& cls, const std::vector<Field>& fields) { |
| 977 | out_ << " std::string DebugString() const {\n" |
| 978 | " std::ostringstream os;\n" |
| 979 | << " os << \"" << cls << "{\";\n"; |
| 980 | for (size_t i = 0; i < fields.size(); ++i) { |
| 981 | if (i) out_ << " os << ' ';\n"; |
| 982 | if (fields[i].type == "bytes") |
| 983 | out_ << " detail::AppendBytes(os, \"" << fields[i].name |
| 984 | << "\", " << fields[i].name << "());\n"; |
| 985 | else |
| 986 | out_ << " detail::AppendField(os, \"" << fields[i].name |
| 987 | << "\", " << fields[i].name << "());\n"; |
| 988 | } |
| 989 | out_ << " os << '}';\n" |
| 990 | " return os.str();\n" |
| 991 | " }\n"; |
| 992 | } |
| 993 | |
| 994 | static std::vector<Field> fieldsFor(const Method& method, Dir direction, bool includeReturn) { |
| 995 | std::vector<Field> fields; |