Deleted Added
sdiff udiff text old ( 4213:37a61d11f39f ) new ( 5756:88038cdbb9e1 )
full compact
1/*
2 * Copyright (c) 2002-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 37 unchanged lines hidden (view full) ---

46#define CPRINTF_DEFINITION VARARGS_DEFINITION(cp::Print)
47
48struct Print
49{
50 protected:
51 std::ostream &stream;
52 const char *format;
53 const char *ptr;
54
55 std::ios::fmtflags saved_flags;
56 char saved_fill;
57 int saved_precision;
58
59 void process(Format &fmt);
60
61 public:
62 Print(std::ostream &stream, const std::string &format);
63 Print(std::ostream &stream, const char *format);
64 ~Print();
65
66 template <typename T>
67 void
68 add_arg(const T &data)
69 {
70 Format fmt;
71 process(fmt);
72
73 switch (fmt.format) {
74 case Format::character:
75 format_char(stream, data, fmt);
76 break;
77
78 case Format::integer:
79 format_integer(stream, data, fmt);
80 break;

--- 83 unchanged lines hidden ---