Lines Matching refs:printer

37 #include <google/protobuf/io/printer.h>
59 Printer printer(&output, '\0');
60 EXPECT_TRUE(!printer.failed());
70 Printer printer(&output, '\0');
72 printer.Print("Hello World!");
73 printer.Print(" This is the same line.\n");
74 printer.Print("But this is a new one.\nAnd this is another one.");
76 EXPECT_FALSE(printer.failed());
96 Printer printer(&output, '$');
97 printer.WriteRaw("Hello World!", 12);
98 printer.PrintRaw(" This is the same line.\n");
99 printer.PrintRaw("But this is a new one.\nAnd this is another one.");
100 printer.WriteRaw("\n", 1);
101 printer.PrintRaw(string_obj);
102 EXPECT_FALSE(printer.failed());
123 Printer printer(&output, '$');
130 printer.Print(vars, "Hello $foo$!\nbar = $bar$\n");
131 printer.PrintRaw("RawBit\n");
132 printer.Print(vars, "$abcdefg$\nA literal dollar sign: $$");
135 printer.Print(vars, "\nNow foo = $foo$.");
137 EXPECT_FALSE(printer.failed());
158 Printer printer(&output, '$');
159 printer.Print("Hello $foo$!\n", "foo", "World");
160 printer.PrintRaw("RawBit\n");
161 printer.Print("$foo$ $bar$\n", "foo", "one", "bar", "two");
162 EXPECT_FALSE(printer.failed());
213 Printer printer(&output, '$', &info_collector);
217 printer.Print(vars, "012$foo$4$bar$\n");
225 printer.Annotate("foo", "foo", &descriptor_1);
226 printer.Annotate("bar", "bar", &descriptor_2);
256 Printer printer(&output, '$', &info_collector);
257 printer.Print("012$foo$4$bar$\n", "foo", "3", "bar", "5");
265 printer.Annotate("foo", "foo", &descriptor_1);
266 printer.Annotate("bar", "bar", &descriptor_2);
296 Printer printer(&output, '$', &info_collector);
297 printer.Print("012$foo$4$bar$\n", "foo", "3", "bar", "5");
301 printer.Annotate("foo", "bar", &descriptor);
320 Printer printer(&output, '$', &info_collector);
321 printer.Print("012$foo$4$baz$$bam$$bar$\n", "foo", "3", "bar", "5", "baz",
326 printer.Annotate("baz", "bam", &descriptor);
345 Printer printer(&output, '$', &info_collector);
346 printer.Print("012$foo$4$foo$$bar$\n", "foo", "3", "bar", "5");
350 printer.Annotate("bar", "bar", &descriptor);
370 Printer printer(&output, '$');
375 printer.Print("This is not indented.\n");
376 printer.Indent();
377 printer.Print("This is indented\nAnd so is this\n");
378 printer.Outdent();
379 printer.Print("But this is not.");
380 printer.Indent();
381 printer.Print(" And this is still the same line.\n"
383 printer.PrintRaw("RawBit has indent at start\n");
384 printer.PrintRaw("but not after a raw newline\n");
385 printer.Print(vars, "Note that a newline in a variable will break "
387 printer.Indent();
388 printer.Print("And this");
389 printer.Outdent();
390 printer.Outdent();
391 printer.Print(" is double-indented\nBack to normal.");
393 EXPECT_FALSE(printer.failed());
420 Printer printer(&output, '$');
422 EXPECT_DEBUG_DEATH(printer.Print("$nosuchvar$"), "Undefined variable");
423 EXPECT_DEBUG_DEATH(printer.Print("$unclosed"), "Unclosed variable name");
424 EXPECT_DEBUG_DEATH(printer.Outdent(), "without matching Indent");
433 Printer printer(&output, '$', &info_collector);
434 printer.Print("012$foo$4$foo$\n", "foo", "3");
438 EXPECT_DEBUG_DEATH(printer.Annotate("foo", "foo", &descriptor), "multiple");
448 Printer printer(&output, '$', &info_collector);
449 printer.Print("012$foo$4$bar$\n", "foo", "3", "bar", "5");
453 EXPECT_DEBUG_DEATH(printer.Annotate("bar", "foo", &descriptor), "negative");
463 Printer printer(&output, '$', &info_collector);
464 printer.Print("012$foo$4$foo$\n", "foo", "3");
468 EXPECT_DEBUG_DEATH(printer.Annotate("bar", "bar", &descriptor),
478 Printer printer(&output, '$');
481 printer.Print("0123456789abcdef");
482 EXPECT_FALSE(printer.failed());
485 printer.Print("<>");
486 EXPECT_TRUE(printer.failed());
489 printer.Print(" ");
490 EXPECT_TRUE(printer.failed());
491 printer.Print("blah");
492 EXPECT_TRUE(printer.failed());
502 Printer printer(&output, '$');
505 printer.Print("0123456789abcdef");
506 EXPECT_FALSE(printer.failed());
509 printer.Print(" ");
510 EXPECT_TRUE(printer.failed());
513 printer.Print("blah");
514 EXPECT_TRUE(printer.failed());