glbarcode++
 
Loading...
Searching...
No Matches
Barcode1dBase.hpp
Go to the documentation of this file.
1// Barcode1dBase.hpp
2//
3// Copyright (C) 2013-2026 Jaye Evins <evins@snaught.com>
4//
5// This file is part of glbarcode++.
6//
7// glbarcode++ is free software: you can redistribute it and/or modify
8// it under the terms of the GNU Lesser General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// glbarcode++ is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU Lesser General Public License for more details.
16//
17// You should have received a copy of the GNU Lesser General Public License
18// along with glbarcode++. If not, see <http://www.gnu.org/licenses/>.
19//
20
21#ifndef glbarcode_Barcode1dBase_hpp
22#define glbarcode_Barcode1dBase_hpp
23
24
25#include <string>
26
27#include "Barcode.hpp"
28#include "Renderer.hpp"
29
30
31namespace glbarcode
32{
33
43 class Barcode1dBase : public Barcode
44 {
45
46 protected:
51
52
53 public:
57 ~Barcode1dBase() override;
58
59
74 Barcode& build( const std::string& data,
75 double w = 0,
76 double h = 0 ) override;
77
78
79 protected:
91 virtual bool validate( const std::string& rawData ) = 0;
92
93
104 virtual std::string preprocess( const std::string& rawData );
105
106
118 virtual std::string encode( const std::string& cookedData ) = 0;
119
120
130 virtual std::string prepareText( const std::string& rawData );
131
132
145 virtual void vectorize( const std::string& encodedData,
146 const std::string& displayText,
147 const std::string& cookedData,
148 double& w,
149 double& h ) = 0;
150
151
152 private:
156 struct PrivateData;
157 PrivateData *d;
158
159 };
160
161}
162
163
164#endif // glbarcode_Barcode1dBase_hpp
Definition Barcode1dBase.hpp:44
Barcode & build(const std::string &data, double w=0, double h=0) override
virtual bool validate(const std::string &rawData)=0
virtual std::string preprocess(const std::string &rawData)
virtual std::string encode(const std::string &cookedData)=0
virtual std::string prepareText(const std::string &rawData)
virtual void vectorize(const std::string &encodedData, const std::string &displayText, const std::string &cookedData, double &w, double &h)=0
Definition Barcode.hpp:52
Definition Barcode.hpp:38