Added copy constructor to zxing::qrcore::ErrorCorrectionLevel

This commit is contained in:
favoritas37 2015-06-14 14:19:12 +03:00
parent 42122c1c62
commit acd7136d9b
2 changed files with 7 additions and 1 deletions

View File

@ -31,6 +31,7 @@ private:
int bits_; int bits_;
std::string name_; std::string name_;
ErrorCorrectionLevel(int inOrdinal, int bits, char const* name); ErrorCorrectionLevel(int inOrdinal, int bits, char const* name);
ErrorCorrectionLevel(const ErrorCorrectionLevel& other);
static ErrorCorrectionLevel *FOR_BITS[]; static ErrorCorrectionLevel *FOR_BITS[];
static int N_LEVELS; static int N_LEVELS;
public: public:

View File

@ -29,7 +29,12 @@ namespace qrcode {
ErrorCorrectionLevel::ErrorCorrectionLevel(int inOrdinal, ErrorCorrectionLevel::ErrorCorrectionLevel(int inOrdinal,
int bits, int bits,
char const* name) : char const* name) :
ordinal_(inOrdinal), bits_(bits), name_(name) {} ordinal_(inOrdinal), bits_(bits), name_(name)
{}
ErrorCorrectionLevel::ErrorCorrectionLevel(const ErrorCorrectionLevel &other) :
ordinal_(other.ordinal()), bits_(other.bits()), name_(other.name())
{}
int ErrorCorrectionLevel::ordinal() const { int ErrorCorrectionLevel::ordinal() const {
return ordinal_; return ordinal_;