Browse Source

[trac749] update gen-rdatacode python script

chenzhengzhang 14 years ago
parent
commit
dbe0eeebf7
1 changed files with 9 additions and 4 deletions
  1. 9 4
      src/lib/dns/gen-rdatacode.py.in

+ 9 - 4
src/lib/dns/gen-rdatacode.py.in

@@ -86,6 +86,13 @@ def import_classheader(class_txt, type_txt, type_code, file):
             continue
             continue
         if re.match('// BEGIN_ISC_NAMESPACE', line):
         if re.match('// BEGIN_ISC_NAMESPACE', line):
             content += 'namespace isc {\n'
             content += 'namespace isc {\n'
+            content += 'namespace util {\n'
+            content += 'namespace io {'
+            content += '''
+class InputBuffer;
+class OutputBuffer;\n'''
+            content += '}\n'
+            content += '}\n\n'
             content += 'namespace dns {\n'
             content += 'namespace dns {\n'
             continue
             continue
         if re.match('// BEGIN_RDATA_NAMESPACE', line):
         if re.match('// BEGIN_RDATA_NAMESPACE', line):
@@ -105,16 +112,14 @@ def import_classheader(class_txt, type_txt, type_code, file):
         content += line
         content += line
         if re.match('// BEGIN_COMMON_DECLARATIONS', line):
         if re.match('// BEGIN_COMMON_DECLARATIONS', line):
             content += '''
             content += '''
-class InputBuffer;
-class OutputBuffer;
 class MessageRenderer;\n\n'''
 class MessageRenderer;\n\n'''
         if re.match('\s+// BEGIN_COMMON_MEMBERS$', line):
         if re.match('\s+// BEGIN_COMMON_MEMBERS$', line):
             content += '''
             content += '''
     explicit ''' + type_utxt + '''(const std::string& type_str);
     explicit ''' + type_utxt + '''(const std::string& type_str);
-    ''' + type_utxt + '''(InputBuffer& buffer, size_t rdata_len);
+    ''' + type_utxt + '''(isc::util::io::InputBuffer& buffer, size_t rdata_len);
     ''' + type_utxt + '''(const ''' + type_utxt + '''& other);
     ''' + type_utxt + '''(const ''' + type_utxt + '''& other);
     virtual std::string toText() const;
     virtual std::string toText() const;
-    virtual void toWire(OutputBuffer& buffer) const;
+    virtual void toWire(isc::util::io::OutputBuffer& buffer) const;
     virtual void toWire(MessageRenderer& renderer) const;
     virtual void toWire(MessageRenderer& renderer) const;
     virtual int compare(const Rdata& other) const;\n\n'''
     virtual int compare(const Rdata& other) const;\n\n'''
     rdata_header.close()
     rdata_header.close()