Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
brotli_inflater.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016 Google Inc.
3  *
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
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
18 
19 #ifndef PAGESPEED_KERNEL_UTIL_BROTLI_INFLATER_H_
20 #define PAGESPEED_KERNEL_UTIL_BROTLI_INFLATER_H_
21 
22 #include <memory>
23 
26 
27 struct BrotliDecoderStateStruct;
28 
29 namespace net_instaweb {
30 
31 class Writer;
32 class MessageHandler;
33 
37  public:
39  ~BrotliInflater();
40 
47  static bool Compress(StringPiece in, MessageHandler* handler, Writer* writer);
48  static bool Compress(StringPiece in, int compression_level,
49  MessageHandler* handler, Writer* writer);
50 
53  static bool Decompress(StringPiece in, MessageHandler* handler,
54  Writer* writer);
55  bool DecompressHelper(StringPiece in, MessageHandler* handler,
56  Writer* writer);
57 
60 
61  private:
63  void ResetState();
64 
67  bool state_used_;
68  std::unique_ptr<BrotliDecoderStateStruct, void(*)(BrotliDecoderStateStruct*)>
69  brotli_state_;
70 
71 
72 };
73 
74 }
75 
76 #endif
static bool Compress(StringPiece in, MessageHandler *handler, Writer *writer)
Definition: brotli_inflater.h:36
Interface for writing bytes to an output stream.
Definition: writer.h:29
Definition: message_handler.h:39
static bool Decompress(StringPiece in, MessageHandler *handler, Writer *writer)