File indexing completed on 2025-10-31 09:04:44
0001 
0002 
0003 
0004 
0005 
0006 
0007 
0008 
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 }  
0043 }  
0044 }  
0045 
0046 #endif