|
GS1 Barcode Syntax Engine — C / C++ API
Library for processing GS1 Application Identifier syntax
|
Header-only C++ wrapper (requires C++17 or later) declared in gs1encoders.hpp, in the gs1encoders namespace.
More...
Namespaces | |
| namespace | gs1encoders |
| Namespace containing the C++ wrapper for the GS1 Barcode Syntax Engine. | |
Data Structures | |
| class | gs1encoders::GS1EncoderException |
| Common base class for all exceptions thrown by this wrapper. More... | |
| class | gs1encoders::GS1EncoderGeneralException |
| Thrown to indicate a general problem initialising the library, such as when the underlying AI table cannot be loaded. More... | |
| class | gs1encoders::GS1EncoderParameterException |
| Thrown to indicate a problem with the parameters or input data passed to a setter. When the failure is a linting failure on AI data, gs1encoders::GS1Encoder::err_markup() returns a marked-up rendering of the offending AI. More... | |
| class | gs1encoders::GS1EncoderDigitalLinkException |
| Thrown to indicate an error processing GS1 Digital Link data. More... | |
| class | gs1encoders::GS1EncoderScanDataException |
| Thrown to indicate an error processing barcode scan data. More... | |
| struct | gs1encoders::InitOpts |
| Initialisation options for the gs1encoders::GS1Encoder constructor. More... | |
| class | gs1encoders::GS1Encoder |
| Main class for processing GS1 barcode data, including validation, format conversion, and generation of outputs such as GS1 Digital Link URIs and Human-Readable Interpretation text. More... | |
Enumerations | |
| enum class | gs1encoders::Symbology : int { gs1encoders::Symbology::None = gs1_encoder_sNONE , gs1encoders::Symbology::DataBarOmni = gs1_encoder_sDataBarOmni , gs1encoders::Symbology::DataBarTruncated = gs1_encoder_sDataBarTruncated , gs1encoders::Symbology::DataBarStacked = gs1_encoder_sDataBarStacked , gs1encoders::Symbology::DataBarStackedOmni = gs1_encoder_sDataBarStackedOmni , gs1encoders::Symbology::DataBarLimited = gs1_encoder_sDataBarLimited , gs1encoders::Symbology::DataBarExpanded = gs1_encoder_sDataBarExpanded , gs1encoders::Symbology::UPCA = gs1_encoder_sUPCA , gs1encoders::Symbology::UPCE = gs1_encoder_sUPCE , gs1encoders::Symbology::EAN13 = gs1_encoder_sEAN13 , gs1encoders::Symbology::EAN8 = gs1_encoder_sEAN8 , gs1encoders::Symbology::GS1_128_CCA = gs1_encoder_sGS1_128_CCA , gs1encoders::Symbology::GS1_128_CCC = gs1_encoder_sGS1_128_CCC , gs1encoders::Symbology::QR = gs1_encoder_sQR , gs1encoders::Symbology::DM = gs1_encoder_sDM , gs1encoders::Symbology::DotCode = gs1_encoder_sDotCode , gs1encoders::Symbology::NumSyms = gs1_encoder_sNUMSYMS } |
| Recognised GS1 barcode formats ("symbologies") for processing scan data. More... | |
| enum class | gs1encoders::Validation : int { gs1encoders::Validation::MutexAIs = gs1_encoder_vMUTEX_AIS , gs1encoders::Validation::RequisiteAIs = gs1_encoder_vREQUISITE_AIS , gs1encoders::Validation::RepeatedAIs = gs1_encoder_vREPEATED_AIS , gs1encoders::Validation::DigSigSerialKey = gs1_encoder_vDIGSIG_SERIAL_KEY , gs1encoders::Validation::UnknownAInotDLattr = gs1_encoder_vUNKNOWN_AI_NOT_DL_ATTR , gs1encoders::Validation::NumValidations = gs1_encoder_vNUMVALIDATIONS } |
| Optional AI validation procedures that may be applied to detect invalid inputs. More... | |
Header-only C++ wrapper (requires C++17 or later) declared in gs1encoders.hpp, in the gs1encoders namespace.
Wraps the C API with a move-only context class (gs1encoders::GS1Encoder), a fluent gs1encoders::InitOpts builder, a typed exception hierarchy rooted at gs1encoders::GS1EncoderException, and enum class mirrors of the C enums. The wrapper introduces no runtime overhead beyond the inline calls into the underlying C library.
The encoder owns the native context and releases it in its destructor, so no manual cleanup call is needed regardless of how the object's lifetime is managed: a function-scoped local, a member of a longer-lived service object, or a std::unique_ptr / std::shared_ptr for shared ownership all work.
Usage:
To load a Syntax Dictionary file instead of the embedded AI table:
|
strong |
Recognised GS1 barcode formats ("symbologies") for processing scan data.
|
strong |
Optional AI validation procedures that may be applied to detect invalid inputs.
These validation procedures are applied when AI data is supplied via gs1encoders::GS1Encoder::set_ai_data_str(), gs1encoders::GS1Encoder::set_data_str() or gs1encoders::GS1Encoder::set_scan_data(). Some procedures are locked (always enabled and not modifiable).