view Core/Compression/ZipWriter.h @ 130:b09b0ffd9941

trying to statically build google log
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Oct 2012 16:47:58 +0200
parents 5317ff5cecc0
children fe180eae201d
line wrap: on
line source

#pragma once

#include <stdint.h>
#include <string>
#include <boost/shared_ptr.hpp>

namespace Orthanc
{
  class ZipWriter
  {
  private:
    struct PImpl;
    boost::shared_ptr<PImpl> pimpl_;

    bool hasFileInZip_;
    uint8_t compressionLevel_;
    std::string path_;

  public:
    ZipWriter();

    ~ZipWriter();

    void SetCompressionLevel(uint8_t level);

    uint8_t GetCompressionLevel() const
    {
      return compressionLevel_;
    }
    
    void Open();

    void Close();

    bool IsOpen() const;

    void SetOutputPath(const char* path);

    const std::string& GetOutputPath() const
    {
      return path_;
    }

    void CreateFileInZip(const char* path);

    void Write(const char* data, size_t length);

    void Write(const std::string& data);
  };
}