| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // http://code.google.com/p/protobuf/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| 11 // * Redistributions in binary form must reproduce the above | 11 // * Redistributions in binary form must reproduce the above |
| 12 // copyright notice, this list of conditions and the following disclaimer | 12 // copyright notice, this list of conditions and the following disclaimer |
| 13 // in the documentation and/or other materials provided with the | 13 // in the documentation and/or other materials provided with the |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Format format_; | 92 Format format_; |
| 93 | 93 |
| 94 ZeroCopyInputStream* sub_stream_; | 94 ZeroCopyInputStream* sub_stream_; |
| 95 | 95 |
| 96 z_stream zcontext_; | 96 z_stream zcontext_; |
| 97 int zerror_; | 97 int zerror_; |
| 98 | 98 |
| 99 void* output_buffer_; | 99 void* output_buffer_; |
| 100 void* output_position_; | 100 void* output_position_; |
| 101 size_t output_buffer_length_; | 101 size_t output_buffer_length_; |
| 102 int64 byte_count_; |
| 102 | 103 |
| 103 int Inflate(int flush); | 104 int Inflate(int flush); |
| 104 void DoNextOutput(const void** data, int* size); | 105 void DoNextOutput(const void** data, int* size); |
| 105 | 106 |
| 106 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipInputStream); | 107 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipInputStream); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 | 110 |
| 110 class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { | 111 class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { |
| 111 public: | 112 public: |
| 112 // Format key for constructor | 113 // Format key for constructor |
| 113 enum Format { | 114 enum Format { |
| 114 // GZIP streams have some extra header data for file attributes. | 115 // GZIP streams have some extra header data for file attributes. |
| 115 GZIP = 1, | 116 GZIP = 1, |
| 116 | 117 |
| 117 // Simpler zlib stream format. | 118 // Simpler zlib stream format. |
| 118 ZLIB = 2, | 119 ZLIB = 2, |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 struct LIBPROTOBUF_EXPORT Options { | 122 struct Options { |
| 122 // Defaults to GZIP. | 123 // Defaults to GZIP. |
| 123 Format format; | 124 Format format; |
| 124 | 125 |
| 125 // What size buffer to use internally. Defaults to 64kB. | 126 // What size buffer to use internally. Defaults to 64kB. |
| 126 int buffer_size; | 127 int buffer_size; |
| 127 | 128 |
| 128 // A number between 0 and 9, where 0 is no compression and 9 is best | 129 // A number between 0 and 9, where 0 is no compression and 9 is best |
| 129 // compression. Defaults to Z_DEFAULT_COMPRESSION (see zlib.h). | 130 // compression. Defaults to Z_DEFAULT_COMPRESSION (see zlib.h). |
| 130 int compression_level; | 131 int compression_level; |
| 131 | 132 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 int Deflate(int flush); | 201 int Deflate(int flush); |
| 201 | 202 |
| 202 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipOutputStream); | 203 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(GzipOutputStream); |
| 203 }; | 204 }; |
| 204 | 205 |
| 205 } // namespace io | 206 } // namespace io |
| 206 } // namespace protobuf | 207 } // namespace protobuf |
| 207 | 208 |
| 208 } // namespace google | 209 } // namespace google |
| 209 #endif // GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__ | 210 #endif // GOOGLE_PROTOBUF_IO_GZIP_STREAM_H__ |
| OLD | NEW |