Commit dbe0eeeb authored by chenzhengzhang's avatar chenzhengzhang
Browse files

[trac749] update gen-rdatacode python script

parent ff81e1bf
......@@ -86,6 +86,13 @@ def import_classheader(class_txt, type_txt, type_code, file):
continue
if re.match('// BEGIN_ISC_NAMESPACE', line):
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'
continue
if re.match('// BEGIN_RDATA_NAMESPACE', line):
......@@ -105,16 +112,14 @@ def import_classheader(class_txt, type_txt, type_code, file):
content += line
if re.match('// BEGIN_COMMON_DECLARATIONS', line):
content += '''
class InputBuffer;
class OutputBuffer;
class MessageRenderer;\n\n'''
if re.match('\s+// BEGIN_COMMON_MEMBERS$', line):
content += '''
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);
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 int compare(const Rdata& other) const;\n\n'''
rdata_header.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment