aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/zipatch/writer.h
blob: 75cbe49777326b1177e72de1956a8dd28d96e78a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once

#include <util/folder/path.h>
#include <util/generic/ptr.h>
#include <util/generic/maybe.h>

namespace NZipatch {

class TWriter {
public:
    struct TOrigin {
        TString Path;
        ui64 Revision;

        inline TOrigin(const TString& path, const ui64 revision)
            : Path(path)
            , Revision(revision)
        { }
    };

     TWriter(const TFsPath& path);
    ~TWriter();

    void Finish();

    void SetBaseSvnRevision(ui64 revision);

    void AddRevprop(const TString& prop, const TString& value);

    void Copy(const TString& path, const TOrigin& origin);

    void MkDir(const TString& path);

    void RemoveFile(const TString& path);

    void RemoveTree(const TString& path);

    void StoreFile(const TString& path,
                   const TString& data,
                   const bool execute,
                   const bool symlink,
                   const TMaybe<bool> binaryHint = Nothing(),
                   const TMaybe<bool> encrypted = Nothing());

private:
    class TImpl;
    THolder<TImpl> Impl_;
};

} // namespace NZipatch