batch refactoring by subclassing a number of classes from Counted to be used with Ref

This commit is contained in:
favoritas37 2015-06-19 01:17:54 +03:00
parent f59fa74ace
commit ef67ff79ef
5 changed files with 15 additions and 8 deletions

View File

@ -21,11 +21,12 @@
*/
#include <zxing/ReaderException.h>
#include <zxing/common/Counted.h>
namespace zxing {
namespace qrcode {
class ErrorCorrectionLevel {
class ErrorCorrectionLevel : public Counted {
private:
int ordinal_;
int bits_;

View File

@ -23,11 +23,13 @@
#include <zxing/common/Counted.h>
#include <zxing/qrcode/Version.h>
#include <zxing/common/Counted.h>
namespace zxing {
namespace qrcode {
class Mode {
class Mode : public Counted
{
private:
int characterCountBitsForVersions0To9_;
int characterCountBitsForVersions10To26_;
@ -53,9 +55,11 @@ public:
static Mode& forBits(int bits);
int getCharacterCountBits(Version *version);
int getBits() { return bits_; }
int getBits() const { return bits_; }
bool operator==(const Mode& other);
std::string getName() const { return name_; }
};
}
}

View File

@ -3,11 +3,12 @@
#include <vector>
#include <string>
#include <zxing/common/Counted.h>
namespace zxing {
namespace qrcode {
class ByteMatrix
class ByteMatrix : public Counted
{
private:
std::vector< std::vector<char> > bytes_;

View File

@ -42,7 +42,7 @@ Ref<Version> QRCode::getVersion() const
return version_ptr_;
}
const int QRCode::getMaskPattern() const
int QRCode::getMaskPattern() const
{
return maskPattern_;
}

View File

@ -5,15 +5,15 @@
#include <zxing/qrcode/Version.h>
#include <zxing/qrcode/ErrorCorrectionLevel.h>
#include "ByteMatrix.h"
#include <zxing/common/Counted.h>
#include <string>
namespace zxing {
namespace qrcode {
class QRCode
class QRCode : public Counted
{
private:
static const int NUM_MASK_PATTERNS = 8;
Ref<Mode> mode_ptr_;
Ref<ErrorCorrectionLevel> ecLevel_ptr_;
@ -22,13 +22,14 @@ private:
Ref<ByteMatrix> matrix_ptr_;
public:
static const int NUM_MASK_PATTERNS = 8;
QRCode();
~QRCode();
Ref<Mode> getMode() const;
Ref<ErrorCorrectionLevel> getECLevel() const;
Ref<Version> getVersion() const;
const int getMaskPattern() const;
int getMaskPattern() const;
Ref<ByteMatrix> getMatrix() const;
const std::string toString();
void setMode(Ref<Mode> value);