comparison mupdf-source/thirdparty/zxing-cpp/core/src/ECI.h @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 /*
2 * Copyright 2022 Axel Waggershauser
3 */
4 // SPDX-License-Identifier: Apache-2.0
5
6 #pragma once
7
8 #include "CharacterSet.h"
9
10 #include <string>
11
12 namespace ZXing {
13
14 enum class ECI : int
15 {
16 Unknown = -1,
17 Cp437 = 2, // obsolete
18 ISO8859_1 = 3,
19 ISO8859_2 = 4,
20 ISO8859_3 = 5,
21 ISO8859_4 = 6,
22 ISO8859_5 = 7,
23 ISO8859_6 = 8,
24 ISO8859_7 = 9,
25 ISO8859_8 = 10,
26 ISO8859_9 = 11,
27 ISO8859_10 = 12,
28 ISO8859_11 = 13,
29 ISO8859_13 = 15,
30 ISO8859_14 = 16,
31 ISO8859_15 = 17,
32 ISO8859_16 = 18,
33 Shift_JIS = 20,
34 Cp1250 = 21,
35 Cp1251 = 22,
36 Cp1252 = 23,
37 Cp1256 = 24,
38 UTF16BE = 25,
39 UTF8 = 26,
40 ASCII = 27,
41 Big5 = 28,
42 GB2312 = 29,
43 EUC_KR = 30,
44 GB18030 = 32,
45 UTF16LE = 33,
46 UTF32BE = 34,
47 UTF32LE = 35,
48 ISO646_Inv = 170,
49 Binary = 899
50 };
51
52 inline constexpr int ToInt(ECI eci)
53 {
54 return static_cast<int>(eci);
55 }
56
57 inline constexpr bool IsText(ECI eci)
58 {
59 return ToInt(eci) >= 0 && ToInt(eci) <= 170;
60 }
61
62 inline constexpr bool CanProcess(ECI eci)
63 {
64 // see https://github.com/zxing-cpp/zxing-cpp/commit/d8587545434d533c4e568181e1c12ef04a8e42d9#r74864359
65 return ToInt(eci) <= 899;
66 }
67
68 /**
69 * @brief ToString converts the numerical ECI value to a 7 character string as used in the ECI protocol
70 * @return e.g. "\000020"
71 */
72 std::string ToString(ECI eci);
73
74 CharacterSet ToCharacterSet(ECI eci);
75
76 ECI ToECI(CharacterSet cs);
77
78 } // namespace ZXing