[svn] commit: r803 - in /branches/jinmei-dnsrdata2/src/lib/dns/cpp: rdata.h rdata/generic/txt_16.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Feb 11 22:50:33 UTC 2010
Author: jinmei
Date: Thu Feb 11 22:50:32 2010
New Revision: 803
Log:
moved MAX_CHARSTRING_LEN from the TXT definition to rdata.h as it's not
specific TXT.
added some more documentation.
Modified:
branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata.h
branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata/generic/txt_16.h
Modified: branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata.h
==============================================================================
--- branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata.h (original)
+++ branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata.h Thu Feb 11 22:50:32 2010
@@ -55,7 +55,9 @@
};
///
-/// \brief A standard DNS module exception that is thrown if ...TBD
+/// \brief A standard DNS module exception that is thrown if RDATA parser
+/// parser encounters a character-string (as defined in RFC1035) exceeding
+/// the maximum allowable length (\c MAX_CHARSTRING_LEN).
///
class CharStringTooLong : public Exception {
public:
@@ -69,6 +71,10 @@
/// \brief Possible maximum length of RDATA, which is the maximum unsigned
/// 16 bit value.
const size_t MAX_RDLENGTH = 65535;
+
+/// \brief The maximum allowable length of character-string containing in
+/// RDATA as defined in RFC1035, not including the 1-byte length field.
+const unsigned int MAX_CHARSTRING_LEN = 255;
/// Abstract RDATA class
class Rdata {
@@ -83,18 +89,6 @@
virtual ~Rdata() {};
///
- /// \name Getter Methods
- //
- // need generic method for getting n-th field? c.f. ldns
- // e.g. string getField(int n);
- ///
- //@{
- // It's not yet clear if we really need to contain the RR type (and/or
- // RR class) in RDATA.
- //virtual const RRType& getType() const = 0;
- //@}
-
- ///
/// \name Converter methods
///
//@{
@@ -135,6 +129,20 @@
GenericImpl* impl_;
};
+///
+/// \brief Insert the name as a string into stream.
+///
+/// This method convert the \c rdata into a string and inserts it into the
+/// output stream \c os.
+///
+/// This function overloads the global \c operator<< to behave as described in
+/// \c ostream::operator<< but applied to \c generic::Generic Rdata objects.
+///
+/// \param os A \c std::ostream object on which the insertion operation is
+/// performed.
+/// \param rdata The \c Generic object output by the operation.
+/// \return A reference to the same \c std::ostream object referenced by
+/// parameter \c os after the insertion operation.
std::ostream&
operator<<(std::ostream& os, const Generic& rdata);
} // end of namespace "generic"
Modified: branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata/generic/txt_16.h
==============================================================================
--- branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata/generic/txt_16.h (original)
+++ branches/jinmei-dnsrdata2/src/lib/dns/cpp/rdata/generic/txt_16.h Thu Feb 11 22:50:32 2010
@@ -37,7 +37,6 @@
private:
/// Note: this is a prototype version; we may reconsider
/// this representation later.
- static const unsigned int MAX_CHARSTRING_LEN = 255;
std::vector<std::vector<uint8_t> > string_list_;
};
More information about the bind10-changes
mailing list