|
@@ -68,6 +68,21 @@ fillParameters(MasterLexer& lexer, uint8_t numdata[20]) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/// \brief Constructor from string.
|
|
|
+///
|
|
|
+/// The given string must represent a valid SOA RDATA. There can be extra
|
|
|
+/// space characters at the beginning or end of the text (which are simply
|
|
|
+/// ignored), but other extra text, including a new line, will make the
|
|
|
+/// construction fail with an exception.
|
|
|
+///
|
|
|
+/// The MNAME and RNAME must be absolute since there's no parameter that
|
|
|
+/// specifies the origin name; if these are not absolute, \c MissingNameOrigin
|
|
|
+/// exception will be thrown.
|
|
|
+///
|
|
|
+/// See the construction that takes \c MasterLexer for other fields.
|
|
|
+///
|
|
|
+/// \throw Others Exception from the Name and RRTTL constructors.
|
|
|
+/// \throw InvalidRdataText Other general syntax errors.
|
|
|
SOA::SOA(const std::string& soastr) :
|
|
|
mname_(Name::ROOT_NAME()), rname_(Name::ROOT_NAME())
|
|
|
{
|
|
@@ -90,6 +105,25 @@ SOA::SOA(const std::string& soastr) :
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/// \brief Constructor with a context of MasterLexer.
|
|
|
+///
|
|
|
+/// The \c lexer should point to the beginning of valid textual representation
|
|
|
+/// of an SOA RDATA. The MNAME and RNAME fields can be non absolute if
|
|
|
+/// \c origin is non NULL, in which case \c origin is used to make them
|
|
|
+/// absolute.
|
|
|
+///
|
|
|
+/// The REFRESH, RETRY, EXPIRE, and MINIMUM fields can be either a valid
|
|
|
+/// decimal representation of an unsigned 32-bit integer or other
|
|
|
+/// valid textual representation of \c RRTTL such as "1H" (which means 3600).
|
|
|
+///
|
|
|
+/// \throw MasterLexer::LexerError General parsing error such as missing field.
|
|
|
+/// \throw Other Exceptions from the Name and RRTTL constructors if
|
|
|
+/// construction of textual fields as these objects fail.
|
|
|
+///
|
|
|
+/// \param lexer A \c MasterLexer object parsing a master file for the
|
|
|
+/// RDATA to be created
|
|
|
+/// \param origin If non NULL, specifies the origin of MNAME and RNAME when
|
|
|
+/// they are non absolute.
|
|
|
SOA::SOA(MasterLexer& lexer, const Name* origin,
|
|
|
MasterLoader::Options, MasterLoaderCallbacks&) :
|
|
|
mname_(createName(lexer, origin)), rname_(createName(lexer, origin))
|