Keyple C++  0.9.0
Keyple, an Open Source SDK for Ticketing
Public Member Functions | List of all members
keyple::common::BerDecoder Class Reference

#include <BerDecoder.h>

Public Member Functions

 BerDecoder (std::vector< char > buf, int offset, int bufsize)
 
int parseByte ()
 
int peekByte ()
 
int parseLength ()
 
std::vector< char > parseOctetString (int tag, std::vector< int > rlen)
 

Constructor & Destructor Documentation

◆ BerDecoder()

keyple::common::BerDecoder::BerDecoder ( std::vector< char >  buf,
int  offset,
int  bufsize 
)
inline

Creates a BER decoder that reads bytes from the specified buffer.

Member Function Documentation

◆ parseByte()

int keyple::common::BerDecoder::parseByte ( )
inline

Parses the next byte in this BER buffer.

Returns
The byte parsed.

◆ parseLength()

int keyple::common::BerDecoder::parseLength ( )
inline

Parses a possibly variable length field.

◆ parseOctetString()

std::vector<char> keyple::common::BerDecoder::parseOctetString ( int  tag,
std::vector< int >  rlen 
)
inline

Parses an octet string of a given type(tag) from this BER buffer.

 BER Binary Data of type "tag" ::= tag length {byte}*
Parameters
tagThe tag to look for.
rlenAn array for returning the relative parsed position. If null, the relative parsed position is not returned.
Returns
A non-null array containing the octet string.
Exceptions
DecodeExceptionIf the next byte in the BER buffer is not tag, or if length specified in the BER buffer exceeds the number of bytes left in the buffer.

◆ peekByte()

int keyple::common::BerDecoder::peekByte ( )
inline

Returns the next byte in this BER buffer without consuming it.

Returns
The next byte.

The documentation for this class was generated from the following file: