Commit 22f3c40f authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

merge from trunk before merge back


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac149@1740 e5f2f494-b856-4b98-b285-d166d9295462
parents 01a95d93 6340cde1
......@@ -31,7 +31,7 @@ class CmdModuleNameFormatError(CmdFormatError):
"""module name format error"""
def __str__(self):
return "Module name format error: the charater of name can only be '0-9a-zA-Z_'"
return "Module name format error: the character of name can only be '0-9a-zA-Z_'"
class CmdCommandNameFormatError(CmdFormatError):
......@@ -41,7 +41,7 @@ class CmdCommandNameFormatError(CmdFormatError):
self.module = module
def __str__(self):
return "Command name format error: the charater of name can only be '0-9a-zA-Z_'"
return "Command name format error: the character of name can only be '0-9a-zA-Z_'"
class CmdMissCommandNameFormatError(CmdFormatError):
......
......@@ -126,8 +126,7 @@ typedef enum {
} ft_state;
}
Name::Name(const std::string &namestring, bool downcase)
{
Name::Name(const std::string &namestring, bool downcase) {
//
// Initialize things to make the compiler happy; they're not required.
//
......@@ -401,20 +400,17 @@ Name::Name(InputBuffer& buffer, bool downcase) {
}
void
Name::toWire(OutputBuffer& buffer) const
{
Name::toWire(OutputBuffer& buffer) const {
buffer.writeData(ndata_.data(), ndata_.size());
}
void
Name::toWire(MessageRenderer& renderer) const
{
Name::toWire(MessageRenderer& renderer) const {
renderer.writeName(*this);
}
std::string
Name::toText(bool omit_final_dot) const
{
Name::toText(bool omit_final_dot) const {
if (length_ == 1) {
//
// Special handling for the root label. We ignore omit_final_dot.
......@@ -493,8 +489,7 @@ Name::toText(bool omit_final_dot) const
}
NameComparisonResult
Name::compare(const Name& other) const
{
Name::compare(const Name& other) const {
// Determine the relative ordering under the DNSSEC order relation of
// 'this' and 'other', and also determine the hierarchical relationship
// of the names.
......@@ -553,8 +548,7 @@ Name::compare(const Name& other) const
}
bool
Name::equals(const Name& other) const
{
Name::equals(const Name& other) const {
if (length_ != other.length_ || labelcount_ != other.labelcount_) {
return (false);
}
......@@ -581,38 +575,32 @@ Name::equals(const Name& other) const
}
bool
Name::leq(const Name& other) const
{
Name::leq(const Name& other) const {
return (compare(other).getOrder() <= 0);
}
bool
Name::geq(const Name& other) const
{
Name::geq(const Name& other) const {
return (compare(other).getOrder() >= 0);
}
bool
Name::lthan(const Name& other) const
{
Name::lthan(const Name& other) const {
return (compare(other).getOrder() < 0);
}
bool
Name::gthan(const Name& other) const
{
Name::gthan(const Name& other) const {
return (compare(other).getOrder() > 0);
}
bool
Name::isWildcard() const
{
Name::isWildcard() const {
return (length_ >= 2 && ndata_[0] == 1 && ndata_[1] == '*');
}
Name
Name::concatenate(const Name& suffix) const
{
Name::concatenate(const Name& suffix) const {
assert(this->length_ > 0 && suffix.length_ > 0);
assert(this->labelcount_ > 0 && suffix.labelcount_ > 0);
......@@ -649,8 +637,7 @@ Name::concatenate(const Name& suffix) const
}
Name
Name::reverse() const
{
Name::reverse() const {
Name retname;
//
// Set up offsets: The size of the string and number of labels will
......@@ -679,8 +666,7 @@ Name::reverse() const
}
Name
Name::split(unsigned int first, unsigned int n) const
{
Name::split(unsigned int first, unsigned int n) const {
if (n == 0 || first + n > labelcount_) {
isc_throw(OutOfRange, "Name::split: invalid split range");
}
......@@ -717,8 +703,7 @@ Name::split(unsigned int first, unsigned int n) const
}
Name&
Name::downcase()
{
Name::downcase() {
unsigned int nlen = length_;
unsigned int labels = labelcount_;
unsigned int pos = 0;
......@@ -746,8 +731,7 @@ Name::downcase()
}
std::ostream&
operator<<(std::ostream& os, const Name& name)
{
operator<<(std::ostream& os, const Name& name) {
os << name.toText();
return (os);
}
......
......@@ -243,8 +243,7 @@ public:
/// method will automatically decompress it.
///
/// If the given data does not represent a valid DNS name, an exception
/// of class \c TooLongName, \c BadLabelType, \c BadPointer, or
/// \c IncompleteName will be thrown.
/// of class \c DNSMessageFORMERR will be thrown.
/// In addition, if resource allocation for the new name fails, a
/// corresponding standard exception will be thrown.
///
......@@ -605,8 +604,7 @@ private:
};
inline const Name&
Name::ROOT_NAME()
{
Name::ROOT_NAME() {
static Name root_name(".");
return (root_name);
}
......
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