Some name cleanup to QrEncode backend.

This commit is contained in:
Jim Evins
2017-05-24 19:46:32 -04:00
parent 662d7a9ef5
commit 52edeaff83
4 changed files with 28 additions and 28 deletions
+1 -3
View File
@@ -22,9 +22,7 @@
#include "glbarcode/Factory.h"
#if HAVE_QRENCODE
#include "BarcodeBackends/QrEncode.h"
#endif // HAVE_QRENCODE
namespace glabels
@@ -80,7 +78,7 @@ namespace glabels
//
registerBackend( "qrencode", "QREncode" );
glbarcode::Factory::registerType( "qrencode::qrcode", barcode::QrEncode::createQrCode );
glbarcode::Factory::registerType( "qrencode::qrcode", QrEncode::QrCode::create );
registerStyle( "qrcode", "qrencode", tr("IEC18004 (QRCode)"),
false, false, true, false, "1234567890AB", false, 12 );
+7 -7
View File
@@ -27,22 +27,22 @@
namespace glabels
{
namespace barcode
namespace QrEncode
{
/*
* Static QrCode barcode creation method
*/
glbarcode::Barcode* QrEncode::createQrCode()
glbarcode::Barcode* QrCode::create()
{
return new QrEncode();
return new QrCode();
}
/*
* QrEncode data validation, implements glbarcode::Barcode2dBase::validate()
* QrCode data validation, implements glbarcode::Barcode2dBase::validate()
*/
bool QrEncode::validate( const std::string& rawData )
bool QrCode::validate( const std::string& rawData )
{
if ( rawData.size() == 0 )
{
@@ -53,9 +53,9 @@ namespace glabels
/*
* QrEncode data encoding, implements glbarcode::Barcode2dBase::encode()
* QrCode data encoding, implements glbarcode::Barcode2dBase::encode()
*/
bool QrEncode::encode( const std::string& cookedData, glbarcode::Matrix<bool>& encodedData )
bool QrCode::encode( const std::string& cookedData, glbarcode::Matrix<bool>& encodedData )
{
QRcode *qrcode = QRcode_encodeString( cookedData.c_str(), 0, QR_ECLEVEL_M, QR_MODE_8, 1 );
if ( qrcode == NULL )
+8 -6
View File
@@ -21,35 +21,37 @@
#ifndef barcode_QrEncode_h
#define barcode_QrEncode_h
#if HAVE_QRENCODE
#include "glbarcode/Barcode2dBase.h"
namespace glabels
{
namespace barcode
namespace QrEncode
{
/**
* LibQREncode barcode backend
* QrEncode::QrCode QR Code Barcode
*
* Implements glbarcode::Barcode2dBase.
*/
class QrEncode : public glbarcode::Barcode2dBase
class QrCode : public glbarcode::Barcode2dBase
{
public:
static Barcode* createQrCode();
static Barcode* create();
private:
bool validate( const std::string& rawData ) override;
bool encode( const std::string& cookedData,
glbarcode::Matrix<bool>& encodedData ) override;
};
}
}
#endif // HAVE_QRENCODE
#endif // barcode_QrEncode_h