minor refactoring in code format

This commit is contained in:
favoritas37 2015-06-05 21:36:27 +03:00
parent a57f8b24d3
commit 61a9f1d55b
3 changed files with 26 additions and 13 deletions

View File

@ -110,7 +110,8 @@ void MatrixUtil::buildMatrix(const BitArray& dataBits,
embedDataBits(dataBits, maskPattern, matrix);
}
void MatrixUtil::embedBasicPatterns(const Version& version, ByteMatrix& matrix) {
void MatrixUtil::embedBasicPatterns(const Version& version, ByteMatrix& matrix)
{
// Let's get started with embedding big squares at corners.
embedPositionDetectionPatternsAndSeparators(matrix);
// Then, embed the dark dot at the left bottom corner.

View File

@ -12,27 +12,33 @@ QRCode::QRCode() :
maskPattern_(-1),
matrix_ptr_(NULL) {}
const Mode *QRCode::getMode() const {
const Mode *QRCode::getMode() const
{
return mode_ptr_;
}
const ErrorCorrectionLevel *QRCode::getECLevel() const {
const ErrorCorrectionLevel *QRCode::getECLevel() const
{
return ecLevel_ptr_;
}
const Version *QRCode::getVersion() const {
const Version *QRCode::getVersion() const
{
return version_ptr_;
}
const int QRCode::getMaskPattern() const {
const int QRCode::getMaskPattern() const
{
return maskPattern_;
}
const ByteMatrix *QRCode::getMatrix() const{
const ByteMatrix *QRCode::getMatrix() const
{
return matrix_ptr_;
}
const std::string QRCode::toString() {
const std::string QRCode::toString()
{
std::stringstream result;
result << "<<\n";
result << " mode: {unimpl}";
@ -53,7 +59,8 @@ const std::string QRCode::toString() {
return result.str();
}
void QRCode::setMode(const Mode& value) {
void QRCode::setMode(const Mode& value)
{
mode_ptr_ = new Mode(value);
}
@ -62,19 +69,23 @@ void QRCode::setMode(const Mode& value) {
* Also make destructors for all
*/
void QRCode::setECLevel(const ErrorCorrectionLevel& value) {
void QRCode::setECLevel(const ErrorCorrectionLevel& value)
{
//ecLevel_ptr_ = value;
}
void QRCode::setVersion(const Version& version) {
void QRCode::setVersion(const Version& version)
{
//version_ptr_ = version;
}
void QRCode::setMaskPattern(int value) {
void QRCode::setMaskPattern(int value)
{
//maskPattern_ptr_ = value;
}
void QRCode::setMatrix(const ByteMatrix &value) {
void QRCode::setMatrix(const ByteMatrix &value)
{
//matrix_ptr_ = value;
}

View File

@ -36,7 +36,8 @@ public:
void setMaskPattern(int value);
void setMatrix(const ByteMatrix& value);
static bool isValidMaskPattern(int maskPattern) {
static bool isValidMaskPattern(int maskPattern)
{
return maskPattern >= 0 && maskPattern < NUM_MASK_PATTERNS;
}