bit7z 4.0.9
A C++ library for interfacing with the 7-zip shared libs.
Loading...
Searching...
No Matches
biterror.hpp
1/*
2 * bit7z - A C++ static library to interface with the 7-zip shared libraries.
3 * Copyright (c) 2014-2023 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 BITERROR_HPP
11#define BITERROR_HPP
12
13#include <system_error>
14
15#include "bitdefines.hpp"
16
17namespace bit7z {
18
22enum struct BitError {
23 Fail = 1,
24 FilterNotSpecified,
25 FormatFeatureNotSupported,
26 IndicesNotSpecified,
27 InvalidArchivePath,
28 InvalidOutputBufferSize,
29 InvalidCompressionMethod,
30 InvalidDictionarySize,
31 InvalidIndex,
32 InvalidWordSize,
33 ItemIsAFolder,
34 ItemMarkedAsDeleted,
35 NoMatchingItems,
36 NoMatchingSignature,
37 NonEmptyOutputBuffer,
38 NullOutputBuffer,
39 RequestedWrongVariantType,
40 UnsupportedOperation,
41 UnsupportedVariantType,
42 WrongUpdateMode,
43 InvalidZipPassword,
44};
45
46auto make_error_code( BitError error ) -> std::error_code;
47
53enum struct BitFailureSource {
54 CRCError,
55 DataAfterEnd,
56 DataError,
57 InvalidArchive,
58 InvalidArgument,
59 FormatDetectionError,
60 HeadersError,
61 NoSuchItem,
62 OperationNotSupported,
63 OperationNotPermitted,
64 UnavailableData,
65 UnexpectedEnd,
66 WrongPassword
67};
68
69auto make_error_condition( BitFailureSource failureSource ) -> std::error_condition;
70
71} // namespace bit7z
72
73namespace std {
74template<>
75struct BIT7Z_MAYBE_UNUSED is_error_code_enum< bit7z::BitError > : public true_type {};
76
77template <>
78struct BIT7Z_MAYBE_UNUSED is_error_condition_enum< bit7z::BitFailureSource > : public true_type {};
79} // namespace std
80
81#endif //BITERROR_HPP
The main namespace of the bit7z library.
Definition bit7zlibrary.hpp:30
BitFailureSource
The BitFailureSource enum struct values represent bit7z error conditions.
Definition biterror.hpp:53
BitError
The BitError enum struct values represent bit7z specific errors.
Definition biterror.hpp:22