Parcourir la source

moved MAX_CHARSTRING_LEN from the TXT definition to rdata.h as it's not
specific TXT.

added some more documentation.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jinmei-dnsrdata2@803 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya il y a 15 ans
Parent
commit
65de16f52b
2 fichiers modifiés avec 21 ajouts et 14 suppressions
  1. 21 13
      src/lib/dns/cpp/rdata.h
  2. 0 1
      src/lib/dns/cpp/rdata/generic/txt_16.h

+ 21 - 13
src/lib/dns/cpp/rdata.h

@@ -55,7 +55,9 @@ public:
 };
 
 ///
-/// \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:
@@ -70,6 +72,10 @@ typedef boost::shared_ptr<Rdata> RdataPtr;
 /// 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 {
 protected:
@@ -83,18 +89,6 @@ public:
     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 @@ private:
     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"

+ 0 - 1
src/lib/dns/cpp/rdata/generic/txt_16.h

@@ -37,7 +37,6 @@ public:
 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_;
 };