File: lzmastream.h

package info (click to toggle)
wxpython4.0 4.2.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 221,752 kB
  • sloc: cpp: 962,555; python: 230,573; ansic: 170,731; makefile: 51,756; sh: 9,342; perl: 1,564; javascript: 584; php: 326; xml: 200
file content (116 lines) | stat: -rw-r--r-- 3,516 bytes parent folder | download | duplicates (4)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
///////////////////////////////////////////////////////////////////////////////
// Name:        wx/lzmastream.h
// Purpose:     LZMA [de]compression classes documentation
// Author:      Vadim Zeitlin
// Created:     2018-03-29
// Copyright:   (c) 2018 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence:     wxWindows licence
///////////////////////////////////////////////////////////////////////////////

/**
    @class wxLZMAInputStream

    This filter stream decompresses data in XZ format.

    XZ format uses LZMA2 algorithm for compression used for .xz files and is
    similar to GZip or BZip2 format. Notice that it is different from, and
    incompatible with, 7z archive format even although it uses the same
    compression algorithm.

    To decompress contents of standard input to standard output, the following
    (not optimally efficient) code could be used:
    @code
    wxFFileInputStream fin(stdin);
    wxLZMAInputStream zin(fin);
    wxFFileOutputStream fout(stdout);
    zin.Read(fout);

    if ( zin.GetLastError() != wxSTREAM_EOF ) {
        ... handle error ...
    }
    @endcode

    See @ref page_build_liblzma for information about liblzma, required in
    order to use this class.

    @library{wxbase}
    @category{archive,streams}

    @see wxInputStream, wxZlibInputStream, wxLZMAOutputStream.

    @since 3.1.2
*/
class wxLZMAInputStream : public wxFilterInputStream
{
public:
    /**
        Create decompressing stream associated with the given underlying
        stream.

        This overload does not take ownership of the @a stream.
    */
    wxLZMAInputStream(wxInputStream& stream);

    /**
        Create decompressing stream associated with the given underlying
        stream and takes ownership of it.

        As with the base wxFilterInputStream class, passing @a stream by
        pointer indicates that this object takes ownership of it and will
        delete it when it is itself destroyed.
     */
    wxLZMAInputStream(wxInputStream* stream);
};

/**
    @class wxLZMAOutputStream

    This filter stream compresses data using XZ format.

    XZ format uses LZMA compression, making it (significantly) more efficient
    than Gzip format used by wxZlibOutputStream. Output generated by this class
    is compatible with xz utilities working with .xz files and also supported
    by 7-Zip program, even though it is different from its native .7z format.

    See @ref page_build_liblzma for information about liblzma, required in
    order to use this class.

    @library{wxbase}
    @category{archive,streams}

    @see wxOutputStream, wxZlibOutputStream, wxLZMAInputStream

    @since 3.1.2
*/
class wxLZMAOutputStream : public wxFilterOutputStream
{
    /**
        Create compressing stream associated with the given underlying
        stream.

        This overload does not take ownership of the @a stream.
    */
    wxLZMAOutputStream(wxOutputStream& stream);

    /**
        Create compressing stream associated with the given underlying
        stream and takes ownership of it.

        As with the base wxFilterOutputStream class, passing @a stream by
        pointer indicates that this object takes ownership of it and will
        delete it when it is itself destroyed.
     */
    wxLZMAOutputStream(wxOutputStream* stream);
};

/**
    Return the version of liblzma library used by LZMA stream classes.

    @see wxVersionInfo

    @header{wx/lzmastream.h}
    @library{wxbase}

    @since 3.1.2
*/
wxVersionInfo wxGetLibLZMAVersionInfo();