| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class String; | 38 class String; |
| 39 | 39 |
| 40 class WTF_EXPORT PrintStream { | 40 class WTF_EXPORT PrintStream { |
| 41 USING_FAST_MALLOC(PrintStream); | 41 USING_FAST_MALLOC(PrintStream); |
| 42 WTF_MAKE_NONCOPYABLE(PrintStream); | 42 WTF_MAKE_NONCOPYABLE(PrintStream); |
| 43 | 43 |
| 44 public: | 44 public: |
| 45 PrintStream(); | 45 PrintStream(); |
| 46 virtual ~PrintStream(); | 46 virtual ~PrintStream(); |
| 47 | 47 |
| 48 void printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); | 48 PRINTF_FORMAT(2, 3) void printf(const char* format, ...); |
| 49 virtual void vprintf(const char* format, va_list) | 49 PRINTF_FORMAT(2, 0) virtual void vprintf(const char* format, va_list) = 0; |
| 50 WTF_ATTRIBUTE_PRINTF(2, 0) = 0; | |
| 51 | 50 |
| 52 // Typically a no-op for many subclasses of PrintStream, this is a hint that | 51 // Typically a no-op for many subclasses of PrintStream, this is a hint that |
| 53 // the implementation should flush its buffers if it had not done so already. | 52 // the implementation should flush its buffers if it had not done so already. |
| 54 virtual void flush(); | 53 virtual void flush(); |
| 55 | 54 |
| 56 template <typename T> | 55 template <typename T> |
| 57 void print(const T& value) { | 56 void print(const T& value) { |
| 58 printInternal(*this, value); | 57 printInternal(*this, value); |
| 59 } | 58 } |
| 60 | 59 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // as ASCII when you wanted it to print as a number. | 124 // as ASCII when you wanted it to print as a number. |
| 126 void dumpCharacter(PrintStream&, char); | 125 void dumpCharacter(PrintStream&, char); |
| 127 MAKE_PRINT_ADAPTOR(CharacterDump, char, dumpCharacter); | 126 MAKE_PRINT_ADAPTOR(CharacterDump, char, dumpCharacter); |
| 128 | 127 |
| 129 } // namespace WTF | 128 } // namespace WTF |
| 130 | 129 |
| 131 using WTF::CharacterDump; | 130 using WTF::CharacterDump; |
| 132 using WTF::PrintStream; | 131 using WTF::PrintStream; |
| 133 | 132 |
| 134 #endif // PrintStream_h | 133 #endif // PrintStream_h |
| OLD | NEW |