[svn] commit: r543 - /branches/parkinglot/src/lib/dns/cpp/message.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jan 27 00:26:34 UTC 2010
Author: jinmei
Date: Wed Jan 27 00:26:33 2010
New Revision: 543
Log:
format fix for Message::toText()
Modified:
branches/parkinglot/src/lib/dns/cpp/message.cc
Modified: branches/parkinglot/src/lib/dns/cpp/message.cc
==============================================================================
--- branches/parkinglot/src/lib/dns/cpp/message.cc (original)
+++ branches/parkinglot/src/lib/dns/cpp/message.cc Wed Jan 27 00:26:33 2010
@@ -447,12 +447,10 @@
section_(section), output_(output) {}
void operator()(const T& entry)
{
- output_ += ";; " + string(sectiontext[section_.getCode()]) +
- " SECTION:\n";
if (section_ == Section::QUESTION()) {
output_ += ";";
}
- output_ += entry->toText() + "\n";
+ output_ += entry->toText();
}
const Section& section_;
string& output_;
@@ -493,23 +491,32 @@
lexical_cast<string>(impl_->counts_[Section::AUTHORITY().getCode()]);
s += ", ADDITIONAL: " +
lexical_cast<string>(impl_->counts_[Section::ADDITIONAL().getCode()])
- + "\n\n";
+ + "\n";
if (!impl_->questions_.empty()) {
+ s += "\n;; " +
+ string(sectiontext[Section::QUESTION().getCode()]) + " SECTION:\n";
for_each(impl_->questions_.begin(), impl_->questions_.end(),
SectionFormatter<QuestionPtr>(Section::QUESTION(), s));
}
if (!impl_->rrsets_[sectionCodeToId(Section::ANSWER())].empty()) {
+ s += "\n;; " +
+ string(sectiontext[Section::ANSWER().getCode()]) + " SECTION:\n";
for_each(impl_->rrsets_[sectionCodeToId(Section::ANSWER())].begin(),
impl_->rrsets_[sectionCodeToId(Section::ANSWER())].end(),
SectionFormatter<RRsetPtr>(Section::ANSWER(), s));
}
if (!impl_->rrsets_[sectionCodeToId(Section::AUTHORITY())].empty()) {
+ s += "\n;; " +
+ string(sectiontext[Section::AUTHORITY().getCode()]) + " SECTION:\n";
for_each(impl_->rrsets_[sectionCodeToId(Section::AUTHORITY())].begin(),
impl_->rrsets_[sectionCodeToId(Section::AUTHORITY())].end(),
SectionFormatter<RRsetPtr>(Section::AUTHORITY(), s));
}
if (!impl_->rrsets_[sectionCodeToId(Section::ADDITIONAL())].empty()) {
+ s += "\n;; " +
+ string(sectiontext[Section::ADDITIONAL().getCode()]) +
+ " SECTION:\n";
for_each(impl_->rrsets_[sectionCodeToId(Section::ADDITIONAL())].begin(),
impl_->rrsets_[sectionCodeToId(Section::ADDITIONAL())].end(),
SectionFormatter<RRsetPtr>(Section::ADDITIONAL(), s));
More information about the bind10-changes
mailing list