Kea 2.5.8
isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode > Class Template Reference

rdata::TXTLikeImpl class represents the TXT-like RDATA for TXT and SPF types. More...

#include <txt_like.h>

Public Member Functions

 TXTLikeImpl (const std::string &txtstr)
 Constructor from string.
 
 TXTLikeImpl (const TXTLikeImpl &other)
 The copy constructor.
 
 TXTLikeImpl (MasterLexer &lexer)
 Constructor using the master lexer.
 
 TXTLikeImpl (util::InputBuffer &buffer, size_t rdata_len)
 Constructor from wire-format data.
 
int compare (const TXTLikeImpl &other) const
 Compare two instances of TXT-like RDATA.
 
std::string toText () const
 Convert the TXT-like data to a string.
 
void toWire (AbstractMessageRenderer &renderer) const
 Render the TXT-like data in the wire format to an AbstractMessageRenderer object.
 
void toWire (util::OutputBuffer &buffer) const
 Render the TXT-like data in the wire format to an OutputBuffer object.
 

Detailed Description

template<class Type, uint16_t typeCode>
class isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >

rdata::TXTLikeImpl class represents the TXT-like RDATA for TXT and SPF types.

This class implements the basic interfaces inherited by the TXT and SPF classes from the abstract rdata::Rdata class, and provides trivial accessors to TXT-like RDATA.

Definition at line 31 of file txt_like.h.

Constructor & Destructor Documentation

◆ TXTLikeImpl() [1/4]

template<class Type , uint16_t typeCode>
isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::TXTLikeImpl ( util::InputBuffer buffer,
size_t  rdata_len 
)
inline

Constructor from wire-format data.

Parameters
bufferA buffer storing the wire format data.
rdata_lenThe length of the RDATA in bytes, normally expected to be the value of the RDLENGTH field of the corresponding RR.

Exceptions

InvalidRdataLength is thrown if rdata_len exceeds the maximum. DNSMessageFORMERR is thrown if the RR is malformed.

Definition at line 43 of file txt_like.h.

References isc_throw, isc::dns::rdata::MAX_RDLENGTH, isc::util::InputBuffer::readData(), and isc::util::InputBuffer::readUint8().

+ Here is the call graph for this function:

◆ TXTLikeImpl() [2/4]

template<class Type , uint16_t typeCode>
isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::TXTLikeImpl ( const std::string &  txtstr)
inlineexplicit

Constructor from string.

Exceptions
CharStringTooLongthe parameter string length exceeds maximum.
InvalidRdataTextthe method cannot process the parameter data

Definition at line 74 of file txt_like.h.

References isc::dns::MasterToken::END_OF_FILE, isc::dns::MasterLexer::getNextToken(), isc::dns::MasterToken::getType(), isc_throw, isc::dns::MasterLexer::pushSource(), and isc::Exception::what().

+ Here is the call graph for this function:

◆ TXTLikeImpl() [3/4]

template<class Type , uint16_t typeCode>
isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::TXTLikeImpl ( MasterLexer lexer)
inline

Constructor using the master lexer.

Exceptions
CharStringTooLongthe parameter string length exceeds maximum.
InvalidRdataTextthe method cannot process the parameter data
Parameters
lexerA MasterLexer object parsing a master file for this RDATA.

Definition at line 100 of file txt_like.h.

◆ TXTLikeImpl() [4/4]

template<class Type , uint16_t typeCode>
isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::TXTLikeImpl ( const TXTLikeImpl< Type, typeCode > &  other)
inline

The copy constructor.

Trivial for now, we could've used the default one.

Definition at line 130 of file txt_like.h.

Member Function Documentation

◆ compare()

template<class Type , uint16_t typeCode>
int isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::compare ( const TXTLikeImpl< Type, typeCode > &  other) const
inline

Compare two instances of TXT-like RDATA.

It is up to the caller to make sure that other is an object of the same TXTLikeImpl class.

Parameters
otherthe right-hand operand to compare against.
Returns
< 0 if this would be sorted before other.
0 if this is identical to other in terms of sorting order.
> 0 if this would be sorted after other.

Definition at line 197 of file txt_like.h.

References isc::util::OutputBuffer::getData(), isc::util::OutputBuffer::getLength(), and isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::toWire().

+ Here is the call graph for this function:

◆ toText()

template<class Type , uint16_t typeCode>
std::string isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::toText ( ) const
inline

Convert the TXT-like data to a string.

Returns
A string object that represents the TXT-like data.

Definition at line 169 of file txt_like.h.

References isc::dns::rdata::generic::detail::charStringToString().

+ Here is the call graph for this function:

◆ toWire() [1/2]

template<class Type , uint16_t typeCode>
void isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::toWire ( AbstractMessageRenderer renderer) const
inline

Render the TXT-like data in the wire format to an AbstractMessageRenderer object.

Parameters
rendererAn output AbstractMessageRenderer to send the wire data to.

Definition at line 155 of file txt_like.h.

References isc::dns::AbstractMessageRenderer::writeData().

+ Here is the call graph for this function:

◆ toWire() [2/2]

template<class Type , uint16_t typeCode>
void isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::toWire ( util::OutputBuffer buffer) const
inline

Render the TXT-like data in the wire format to an OutputBuffer object.

Parameters
bufferAn output buffer to store the wire data.

Definition at line 139 of file txt_like.h.

References isc::util::OutputBuffer::writeData().

Referenced by isc::dns::rdata::generic::detail::TXTLikeImpl< Type, typeCode >::compare().

+ Here is the call graph for this function:

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