bit7z
4.1.0
A C++ library for interfacing with the 7-zip shared libs.
Toggle main menu visibility
Loading...
Searching...
No Matches
bit7zlibrary.hpp
1
/*
2
* bit7z - A C++ static library to interface with the 7-zip shared libraries.
3
* Copyright (c) Riccardo Ostani - All Rights Reserved.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
*/
9
10
#ifndef BIT7ZLIBRARY_HPP
11
#define BIT7ZLIBRARY_HPP
12
13
#include "bitdefines.hpp"
14
#include "bitformat.hpp"
15
#include "bitsharedlibrary.hpp"
16
#include "bittypes.hpp"
17
19
struct
IInArchive;
20
struct
IOutArchive;
21
22
template
<
typename
T >
23
class
CMyComPtr;
25
29
namespace
bit7z
{
30
42
#ifdef __DOXYGEN__
43
constexpr
auto
kDefaultLibrary
=
"<platform-dependent value>"
;
44
#elif defined( _WIN32 )
45
constexpr
auto
kDefaultLibrary
= BIT7Z_STRING(
"7z.dll"
);
46
#elif defined( __linux__ )
47
constexpr
auto
kDefaultLibrary
=
"/usr/lib/p7zip/7z.so"
;
// Default installation path of the p7zip shared library.
48
#else
49
constexpr
auto
kDefaultLibrary
=
"./7z.so"
;
50
#endif
51
55
class
Bit7zLibrary final {
56
public
:
57
Bit7zLibrary(
const
Bit7zLibrary& ) =
delete
;
58
59
Bit7zLibrary( Bit7zLibrary&& ) =
delete
;
60
61
auto
operator=(
const
Bit7zLibrary& ) -> Bit7zLibrary& =
delete
;
62
63
auto
operator=( Bit7zLibrary&& ) -> Bit7zLibrary& =
delete
;
64
72
explicit
Bit7zLibrary
(
const
tstring
& libraryPath =
kDefaultLibrary
);
73
77
~Bit7zLibrary
() =
default
;
78
84
BIT7Z_DEPRECATED_MSG(
"Since v4.1. Please use the useLargePages() method."
)
85
void
setLargePageMode
();
86
90
void
useLargePages
() const;
91
92
private:
93
BitSharedLibrary mLibrary;
94
LibrarySymbol mCreateObjectFunc;
95
96
BIT7Z_NODISCARD
97
auto initInArchive( const
BitInFormat
& format ) const -> CMyComPtr< IInArchive >;
98
99
BIT7Z_NODISCARD
100
auto initOutArchive( const
BitInOutFormat
& format ) const -> CMyComPtr< IOutArchive >;
101
102
friend class BitInputArchive;
103
friend class BitOutputArchive;
104
};
105
106
}
// namespace bit7z
107
108
#endif
// BIT7ZLIBRARY_HPP
bit7z::Bit7zLibrary::~Bit7zLibrary
~Bit7zLibrary()=default
Destructs the Bit7zLibrary object, freeing the loaded shared library.
bit7z::Bit7zLibrary::setLargePageMode
void setLargePageMode()
Set the 7-zip shared library to use large memory pages.
bit7z::Bit7zLibrary::useLargePages
void useLargePages() const
Set the 7-zip shared library to use large memory pages.
bit7z::Bit7zLibrary::Bit7zLibrary
Bit7zLibrary(const tstring &libraryPath=kDefaultLibrary)
Constructs a Bit7zLibrary object by loading the specified 7zip shared library.
bit7z::BitInFormat
The BitInFormat class specifies an extractable archive format.
Definition
bitformat.hpp:68
bit7z::BitInOutFormat
The BitInOutFormat class specifies a format available for creating new archives and extract old ones.
Definition
bitformat.hpp:115
bit7z
The main namespace of the bit7z library.
Definition
bit7zlibrary.hpp:29
bit7z::kDefaultLibrary
constexpr auto kDefaultLibrary
The default file path for the 7-zip shared library to be used by bit7z in case the user doesn't pass ...
Definition
bit7zlibrary.hpp:43
bit7z::tstring
std::basic_string< tchar > tstring
Definition
bittypes.hpp:104
include
bit7z
bit7zlibrary.hpp
Generated by
1.17.0