Stroika Library 3.0d18
 
Loading...
Searching...
No Matches
GZip.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_Compression_GZip_h_
5#define _Stroika_Foundation_DataExchange_Compression_GZip_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10
11/**
12 * \file
13 *
14 * https://en.wikipedia.org/wiki/GZip
15 *
16 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
17 */
18
19namespace Stroika::Foundation::DataExchange::Compression::GZip {
20
21 /**
22 * Check at compile time if GZip is supported.
23 */
24 constexpr bool kSupported =
25#if qStroika_HasComponent_zlib
26 true
27#else
28 false
29#endif
30 ;
31
32 /**
33 * \par Example Usage
34 * \code
35 * Memory::BLOB kSample1_ = Memory::BLOB::Hex ("aa1234abcd01010102030405");
36 * Memory::BLOB compressed = Compression::GZip::Compress::New ().Transform (kSample1_);
37 * Assert (kSample1_ == Compression::Compression::GZip::Decompress::New ().Transform (compressed));
38 * \endcode
39 *
40 * \note if not kSupported, these 'New ()' functions just throw FeatureNotSupportedException{}
41 */
42 namespace Compress {
43 struct Options : Compression::Compress::Options {
44 // NYI (see https://stackoverflow.com/questions/72499500/whats-special-about-deflateinit2-that-prevents-deflatesetheader-be-used-with-de)
45 optional<Memory::BLOB> fDictionary;
46 };
47 Ptr New (const Options& o = {});
48 }
49 namespace Decompress {
50 struct Options : Compression::Compress::Options {
51 // NYI (see https://stackoverflow.com/questions/72499500/whats-special-about-deflateinit2-that-prevents-deflatesetheader-be-used-with-de)
52 optional<Memory::BLOB> fDictionary;
53 };
54 Ptr New (const Options& o = {});
55 }
56
57}
58
59/*
60 ********************************************************************************
61 ***************************** Implementation Details ***************************
62 ********************************************************************************
63 */
64
65#endif /*_Stroika_Foundation_DataExchange_Compression_GZip_h_*/