refactoring BlockPair to use ArrayRef instead of std::vector.

This commit is contained in:
favoritas37 2015-06-14 20:43:04 +03:00
parent 85cb7db29d
commit b0ea32e95c
1 changed files with 8 additions and 9 deletions

View File

@ -2,6 +2,7 @@
#define BLOCKPAIR_H #define BLOCKPAIR_H
#include <vector> #include <vector>
#include <zxing/common/Array.h>
using namespace std; using namespace std;
@ -11,20 +12,18 @@ namespace qrcode {
class BlockPair class BlockPair
{ {
private: private:
vector<char> data_; ArrayRef<char> data_;
vector<char> errorCorrection_; ArrayRef<char> errorCorrection_;
public: public:
BlockPair(const vector<char> &data, const vector<char> &errorCorrection) : BlockPair(ArrayRef<char> data, ArrayRef<char> errorCorrection) :
data_(data), errorCorrection_(errorCorrection) {} data_(data), errorCorrection_(errorCorrection) {}
vector<char> getDataBytes() { BlockPair(const BlockPair& other) : data_(other.data_), errorCorrection_(other.errorCorrection_) {}
return data_;
}
vector<char> getErrorCorrectionBytes() { ArrayRef<char> getDataBytes() { return data_; }
return errorCorrection_;
} ArrayRef<char> getErrorCorrectionBytes() { return errorCorrection_; }
}; };
} }