mirror of
https://github.com/status-im/qzxing.git
synced 2025-01-14 04:54:31 +00:00
refactoring BlockPair to use ArrayRef instead of std::vector.
This commit is contained in:
parent
85cb7db29d
commit
b0ea32e95c
@ -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_; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user