Home | History | Annotate | Download | only in aidl

Lines Matching refs:Write

44 void ClassDecl::Write(CodeWriter* to) const {
45 to->Write("class %s ", name_.c_str());
48 to->Write(": public %s ", parent_.c_str());
50 to->Write("{\n");
53 to->Write("public:\n");
56 dec->Write(to);
59 to->Write("private:\n");
62 dec->Write(to);
64 to->Write("}; // class %s\n", name_.c_str());
84 void Enum::Write(CodeWriter* to) const {
86 to->Write("enum %s {\n", enum_name_.c_str());
88 to->Write("enum %s : %s {\n", enum_name_.c_str(), underlying_type_.c_str());
92 to->Write(" %s,\n", field.key.c_str());
94 to->Write(" %s = %s,\n", field.key.c_str(), field.value.c_str());
97 to->Write("};\n");
119 void ArgList::Write(CodeWriter* to) const {
120 to->Write("(");
123 if (!is_first) { to->Write(", "); }
125 s->Write(to);
127 to->Write(")");
143 void ConstructorDecl::Write(CodeWriter* to) const {
145 to->Write("virtual ");
148 to->Write("explicit ");
150 to->Write("%s", name_.c_str());
152 arguments_.Write(to);
155 to->Write(" = default");
157 to->Write(";\n");
164 void MacroDecl::Write(CodeWriter* to) const {
165 to->Write("%s", name_.c_str());
166 arguments_.Write(to);
167 to->Write("\n");
188 void MethodDecl::Write(CodeWriter* to) const {
190 to->Write("virtual ");
193 to->Write("static ");
195 to->Write("%s %s", return_type_.c_str(), name_.c_str());
197 arguments_.Write(to);
200 to->Write(" const");
203 to->Write(" override");
206 to->Write(" = 0");
208 to->Write(";\n");
229 void StatementBlock::Write(CodeWriter* to) const {
230 to->Write("{\n");
232 statement->Write(to);
234 to->Write("}\n");
244 void ConstructorImpl::Write(CodeWriter* to) const {
245 to->Write("%s::%s", class_name_.c_str(), class_name_.c_str());
246 arguments_.Write(to);
247 to->Write("\n");
252 to->Write(" : %s", i.c_str());
254 to->Write(",\n %s", i.c_str());
259 body_.Write(to);
280 void MethodImpl::Write(CodeWriter* to) const {
281 to->Write("%s %s", return_type_.c_str(), method_name_.c_str());
282 arguments_.Write(to);
283 to->Write("%s ", (is_const_method_) ? " const" : "");
284 statements_.Write(to);
302 void SwitchStatement::Write(CodeWriter* to) const {
303 to->Write("switch (%s) {\n", switch_expression_.c_str());
308 to->Write("default:\n");
310 to->Write("case %s:\n", case_value.c_str());
312 statements->Write(to);
313 to->Write("break;\n");
315 to->Write("}\n");
326 void Assignment::Write(CodeWriter* to) const {
327 to->Write("%s = ", lhs_.c_str());
328 rhs_->Write(to);
329 to->Write(";\n");
341 void MethodCall::Write(CodeWriter* to) const {
342 to->Write("%s", method_name_.c_str());
343 arguments_.Write(to);
350 void IfStatement::Write(CodeWriter* to) const {
351 to->Write("if (%s", (invert_expression_) ? "!(" : "");
352 expression_->Write(to);
353 to->Write(")%s ", (invert_expression_) ? ")" : "");
354 on_true_.Write(to);
357 to->Write("else ");
358 on_false_.Write(to);
370 void Statement::Write(CodeWriter* to) const {
371 expression_->Write(to);
372 to->Write(";\n");
380 void Comparison::Write(CodeWriter* to) const {
381 to->Write("((");
382 left_->Write(to);
383 to->Write(") %s (", operator_.c_str());
384 right_->Write(to);
385 to->Write("))");
391 void LiteralExpression::Write(CodeWriter* to) const {
392 to->Write("%s", expression_.c_str());
408 void CppNamespace::Write(CodeWriter* to) const {
409 to->Write("namespace %s {\n\n", name_.c_str());
412 dec->Write(to);
413 to->Write("\n");
416 to->Write("} // namespace %s\n", name_.c_str());
424 void Document::Write(CodeWriter* to) const {
426 to->Write("#include <%s>\n", include.c_str());
428 to->Write("\n");
430 namespace_->Write(to);
439 void CppHeader::Write(CodeWriter* to) const {
440 to->Write("#ifndef %s\n", include_guard_.c_str());
441 to->Write("#define %s\n\n", include_guard_.c_str());
443 Document::Write(to);
444 to->Write("\n");
446 to->Write("#endif // %s\n", include_guard_.c_str());