2
* Copyright 2010 Google Inc.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
17
// Author: jmarantz@google.com (Joshua Marantz)
19
#ifndef PAGESPEED_KERNEL_BASE_NULL_WRITER_H_
20
#define PAGESPEED_KERNEL_BASE_NULL_WRITER_H_
22
#include "pagespeed/kernel/base/writer.h"
23
#include "pagespeed/kernel/base/string_util.h"
25
namespace net_instaweb {
28
// A writer that silently eats the bytes. This can be used, for
29
// example, with writers is designed to cascade to another one, such
30
// as CountingWriter. If you just want to count the bytes and don't
31
// want to store them, you can pass a NullWriter to a CountingWriter's
33
class NullWriter : public Writer {
35
explicit NullWriter() { }
36
virtual ~NullWriter();
37
virtual bool Write(const StringPiece& str, MessageHandler* handler);
38
virtual bool Flush(MessageHandler* handler);
41
} // namespace net_instaweb
43
#endif // PAGESPEED_KERNEL_BASE_NULL_WRITER_H_