1 // This file is part of OpenCV project. 2 // It is subject to the license terms in the LICENSE file found in the top-level directory 3 // of this distribution and at http://opencv.org/license.html. 4 // 5 // Tencent is pleased to support the open source community by making WeChat QRCode available. 6 // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. 7 // 8 // Modified from ZXing. Copyright ZXing authors. 9 // Licensed under the Apache License, Version 2.0 (the "License"). 10 11 #ifndef __ZXING_COMMON_CHARACTERSETECI_HPP__ 12 #define __ZXING_COMMON_CHARACTERSETECI_HPP__ 13 14 #include <map> 15 #include "../decodehints.hpp" 16 #include "counted.hpp" 17 18 namespace zxing { 19 namespace common { 20 21 class CharacterSetECI : public Counted { 22 private: 23 static std::map<int, zxing::Ref<CharacterSetECI> > VALUE_TO_ECI; 24 static std::map<std::string, zxing::Ref<CharacterSetECI> > NAME_TO_ECI; 25 static const bool inited; 26 static bool init_tables(); 27 28 int const* const values_; 29 char const* const* const names_; 30 31 CharacterSetECI(int const* values, char const* const* names); 32 33 static void addCharacterSet(int const* value, char const* const* encodingNames); 34 35 public: 36 char const* name() const; 37 int getValue() const; 38 39 static CharacterSetECI* getCharacterSetECIByValueFind(int value); 40 static CharacterSetECI* getCharacterSetECIByName(std::string const& name); 41 }; 42 43 } // namespace common 44 } // namespace zxing 45 46 #endif // __ZXING_COMMON_CHARACTERSETECI_HPP__ 47