|
@@ -24,6 +24,9 @@
|
|
#include <exceptions/exceptions.h>
|
|
#include <exceptions/exceptions.h>
|
|
|
|
|
|
#include <dns/rdata.h>
|
|
#include <dns/rdata.h>
|
|
|
|
+#include <dns/master_lexer.h>
|
|
|
|
+#include <dns/master_loader.h>
|
|
|
|
+#include <dns/master_loader_callbacks.h>
|
|
|
|
|
|
namespace isc {
|
|
namespace isc {
|
|
namespace dns {
|
|
namespace dns {
|
|
@@ -82,7 +85,7 @@ public:
|
|
/// \name Factory methods for polymorphic creation.
|
|
/// \name Factory methods for polymorphic creation.
|
|
///
|
|
///
|
|
//@{
|
|
//@{
|
|
- ///
|
|
|
|
|
|
+
|
|
/// \brief Create RDATA from a string.
|
|
/// \brief Create RDATA from a string.
|
|
///
|
|
///
|
|
/// This method creates from a string an \c Rdata object of specific class
|
|
/// This method creates from a string an \c Rdata object of specific class
|
|
@@ -91,7 +94,7 @@ public:
|
|
/// \param rdata_str A string of textual representation of the \c Rdata.
|
|
/// \param rdata_str A string of textual representation of the \c Rdata.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
virtual RdataPtr create(const std::string& rdata_str) const = 0;
|
|
virtual RdataPtr create(const std::string& rdata_str) const = 0;
|
|
- ///
|
|
|
|
|
|
+
|
|
/// \brief Create RDATA from wire-format data.
|
|
/// \brief Create RDATA from wire-format data.
|
|
///
|
|
///
|
|
/// This method creates from wire-format binary data an \c Rdata object
|
|
/// This method creates from wire-format binary data an \c Rdata object
|
|
@@ -103,7 +106,7 @@ public:
|
|
/// \param rdata_len The length in buffer of the \c Rdata. In bytes.
|
|
/// \param rdata_len The length in buffer of the \c Rdata. In bytes.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
virtual RdataPtr create(isc::util::InputBuffer& buffer, size_t rdata_len) const = 0;
|
|
virtual RdataPtr create(isc::util::InputBuffer& buffer, size_t rdata_len) const = 0;
|
|
- ///
|
|
|
|
|
|
+
|
|
/// \brief Create RDATA from another \c Rdata object of the same type.
|
|
/// \brief Create RDATA from another \c Rdata object of the same type.
|
|
///
|
|
///
|
|
/// This method creates an \c Rdata object of specific class corresponding
|
|
/// This method creates an \c Rdata object of specific class corresponding
|
|
@@ -118,6 +121,29 @@ public:
|
|
/// be copied to the created \c Rdata object.
|
|
/// be copied to the created \c Rdata object.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
/// \return An \c RdataPtr object pointing to the created \c Rdata object.
|
|
virtual RdataPtr create(const rdata::Rdata& source) const = 0;
|
|
virtual RdataPtr create(const rdata::Rdata& source) const = 0;
|
|
|
|
+
|
|
|
|
+ /// \brief Create RDATA from MasterLexer
|
|
|
|
+ virtual RdataPtr create(MasterLexer& lexer, const Name*,
|
|
|
|
+ MasterLoader::Options,
|
|
|
|
+ MasterLoaderCallbacks&) const {
|
|
|
|
+ std::string s;
|
|
|
|
+
|
|
|
|
+ while (true) {
|
|
|
|
+ const MasterLexer::Token& token = lexer.getNextToken();
|
|
|
|
+ if (token.getType() == MasterLexer::Token::END_OF_FILE) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!s.empty()) {
|
|
|
|
+ s += " ";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ s += token.getString();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return (create(s));
|
|
|
|
+ }
|
|
|
|
+
|
|
//@}
|
|
//@}
|
|
};
|
|
};
|
|
|
|
|