PcapPlusPlus  Next
pcpp::Asn1IntegerRecord Class Reference

#include <Asn1Codec.h>

Inheritance diagram for pcpp::Asn1IntegerRecord:
pcpp::Asn1PrimitiveRecord pcpp::Asn1Record pcpp::Asn1EnumeratedRecord

Public Member Functions

 Asn1IntegerRecord (uint64_t value)
 
 Asn1IntegerRecord (const std::string &value)
 
template<typename T , EnableIfUnsignedIntegral< T > = 0>
getIntValue ()
 
uint32_t getValue ()
 
std::string getValueAsString ()
 
- Public Member Functions inherited from pcpp::Asn1Record
std::vector< uint8_t > encode ()
 
Asn1TagClass getTagClass () const
 
bool isConstructed () const
 
Asn1UniversalTagType getUniversalTagType () const
 
uint8_t getTagType () const
 
size_t getValueLength () const
 
size_t getTotalLength () const
 
std::string toString ()
 
template<class Asn1RecordType >
Asn1RecordType * castAs ()
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::Asn1Record
static std::unique_ptr< Asn1Recorddecode (const uint8_t *data, size_t dataLen, bool lazy=true)
 

Detailed Description

Represents an ASN.1 record with a value of type Integer

Constructor & Destructor Documentation

◆ Asn1IntegerRecord() [1/2]

pcpp::Asn1IntegerRecord::Asn1IntegerRecord ( uint64_t  value)
explicit

A constructor to create a record of type Integer

Parameters
valueAn integer to set as the record value

◆ Asn1IntegerRecord() [2/2]

pcpp::Asn1IntegerRecord::Asn1IntegerRecord ( const std::string &  value)
explicit

A constructor to create a record of type Integer

Parameters
valueAn integer represented as a hex stream to set as the record value
Exceptions
std::invalid_argumentif the value isn't a valid hex stream

Member Function Documentation

◆ getIntValue()

template<typename T , EnableIfUnsignedIntegral< T > = 0>
T pcpp::Asn1IntegerRecord::getIntValue ( )
inline
Returns
The integer value of this record
Exceptions
std::invalid_argumentif the value doesn't fit the requested integer size

◆ getValue()

uint32_t pcpp::Asn1IntegerRecord::getValue ( )
inline
Deprecated:
This method is deprecated, please use getIntValue()

◆ getValueAsString()

std::string pcpp::Asn1IntegerRecord::getValueAsString ( )
inline
Returns
A hex string representation of the record value