Keyple C++
0.9.0
Keyple, an Open Source SDK for Ticketing
|
#include <TLV.h>
Inherits enable_shared_from_this< TLV >.
Public Member Functions | |
TLV (const std::vector< uint8_t > &binary) | |
bool | parse (std::shared_ptr< Tag > tag, int offset) |
const std::vector< uint8_t > | getValue () |
int | getPosition () const |
Friends | |
KEYPLECORE_API std::ostream & | operator<< (std::ostream &os, const TLV &tlv) |
This class helps to parse a byte array as a TLV structure
(ITU-T X.690 / ISO 8825)
keyple::core::util::bertlv::TLV::TLV | ( | const std::vector< uint8_t > & | binary | ) |
int keyple::core::util::bertlv::TLV::getPosition | ( | ) | const |
const std::vector< uint8_t > keyple::core::util::bertlv::TLV::getValue | ( | ) |
Return a byte array copied from the main array corresponding to value part of the last TLV parsing.
This method modifies the global position in the main array. Thus, it must be called once only.
bool keyple::core::util::bertlv::TLV::parse | ( | std::shared_ptr< Tag > | tag, |
int | offset | ||
) |
Parse the byte array to find the expected TLV.
The method returns true if the tag is found.
The analysis result is available with getValue and getPosition
tag | the tag to search in the byte array |
offset | the position to start in the byte array |
|
friend |