Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:01

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 // Author: kenton@google.com (Kenton Varda)
0009 #ifndef GOOGLE_PROTOBUF_COMPILER_ZIP_WRITER_H__
0010 #define GOOGLE_PROTOBUF_COMPILER_ZIP_WRITER_H__
0011 
0012 #include <cstdint>
0013 #include <vector>
0014 
0015 #include "google/protobuf/stubs/common.h"
0016 #include "google/protobuf/io/zero_copy_stream.h"
0017 
0018 namespace google {
0019 namespace protobuf {
0020 namespace compiler {
0021 
0022 class ZipWriter {
0023  public:
0024   ZipWriter(io::ZeroCopyOutputStream* raw_output);
0025   ~ZipWriter();
0026 
0027   bool Write(const std::string& filename, const std::string& contents);
0028   bool WriteDirectory();
0029 
0030  private:
0031   struct FileInfo {
0032     std::string name;
0033     uint32_t offset;
0034     uint32_t size;
0035     uint32_t crc32;
0036   };
0037 
0038   io::ZeroCopyOutputStream* raw_output_;
0039   std::vector<FileInfo> files_;
0040 };
0041 
0042 }  // namespace compiler
0043 }  // namespace protobuf
0044 }  // namespace google
0045 
0046 #endif  // GOOGLE_PROTOBUF_COMPILER_ZIP_WRITER_H__