bit7z 4.0.0
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 RequestedWrongVariantType,
39 UnsupportedOperation,
40 UnsupportedVariantType,
41 WrongUpdateMode,
42 InvalidZipPassword,
43};
44
45auto make_error_code( BitError error ) -> std::error_code;
46
52enum struct BitFailureSource {
53 CRCError,
54 DataAfterEnd,
55 DataError,
56 InvalidArchive,
57 InvalidArgument,
58 FormatDetectionError,
59 HeadersError,
60 NoSuchItem,
61 OperationNotSupported,
62 OperationNotPermitted,
63 UnavailableData,
64 UnexpectedEnd,
65 WrongPassword
66};
67
68auto make_error_condition( BitFailureSource failureSource ) -> std::error_condition;
69
70} // namespace bit7z
71
72namespace std {
73template<>
74struct BIT7Z_MAYBE_UNUSED is_error_code_enum< bit7z::BitError > : public true_type {};
75
76template <>
77struct BIT7Z_MAYBE_UNUSED is_error_condition_enum< bit7z::BitFailureSource > : public true_type {};
78} // namespace std
79
80#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:52
BitError
The BitError enum struct values represent bit7z specific errors.
Definition biterror.hpp:22