/// be the bare char basis.
typedef std::vector<uint8_t> CharString;
+/// \brief Convert a DNS character-string into corresponding binary data.
+///
+/// This helper function takes a string object that is expected to be a
+/// textual representation of a valid DNS character-string, and dumps
+/// the corresponding binary sequence in the given placeholder (passed
+/// via the \c result parameter). It handles escape notations of
+/// character-strings with a backslash ('\'), and checks the length
+/// restriction.
+///
+/// \throw CharStringTooLong The resulting binary data are too large for a
+/// valid character-string.
+/// \throw InvalidRdataText Other syntax errors.
+///
+/// \brief str_region A string that represents a character-string.
+/// \brief result A placeholder vector where the resulting data are to be
+/// stored. Expected to be empty, but it's not checked.
void strToCharString(const MasterToken::StringRegion& str_region,
CharString& result);
}
}
+ /// \brief Constructor using the master lexer.
+ ///
+ /// This implementation only uses the \c lexer parameters; others are
+ /// ignored.
+ ///
+ /// \throw CharStringTooLong the parameter string length exceeds maximum.
+ /// \throw InvalidRdataText the method cannot process the parameter data
+ ///
+ /// \param lexer A \c MasterLexer object parsing a master file for this
+ /// RDATA.
TXTLikeImpl(MasterLexer& lexer, const Name*, MasterLoader::Options,
MasterLoaderCallbacks&)
{
impl_(new SPFImpl(buffer, rdata_len))
{}
-
-/// \brief Constructor from TBD
+/// \brief Constructor using the master lexer.
+///
+/// This implementation only uses the \c lexer parameters; others are
+/// ignored.
+///
+/// \throw CharStringTooLong the parameter string length exceeds maximum.
+/// \throw InvalidRdataText the method cannot process the parameter data
+///
+/// \param lexer A \c MasterLexer object parsing a master file for this
+/// RDATA.
SPF::SPF(MasterLexer& lexer, const Name* origin,
MasterLoader::Options options, MasterLoaderCallbacks& callbacks) :
impl_(new SPFImpl(lexer, origin, options, callbacks))
impl_(new TXTImpl(buffer, rdata_len))
{}
+/// \brief Constructor using the master lexer.
+///
+/// This implementation only uses the \c lexer parameters; others are
+/// ignored.
+///
+/// \throw CharStringTooLong the parameter string length exceeds maximum.
+/// \throw InvalidRdataText the method cannot process the parameter data
+///
+/// \param lexer A \c MasterLexer object parsing a master file for this
+/// RDATA.
TXT::TXT(MasterLexer& lexer, const Name* origin,
MasterLoader::Options options, MasterLoaderCallbacks& callbacks) :
impl_(new TXTImpl(lexer, origin, options, callbacks))