Commit daff3480 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

use lower-cased namespaces based on coding style guidelines


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@144 e5f2f494-b856-4b98-b285-d166d9295462
parent 0c7589ab
......@@ -19,7 +19,7 @@
#include <dns/buffer.h>
using ISC::SingleBuffer;
using isc::SingleBuffer;
// The interface should be revisited.
int
......@@ -37,7 +37,7 @@ SingleBuffer::recv_from(int s, struct sockaddr* from, socklen_t* from_len)
int cc;
if (!buf_.empty())
throw ISC::ISCBufferInvalidPosition();
throw isc::ISCBufferInvalidPosition();
buf_.resize(buf_.capacity());
cc = recvfrom(s, &buf_[0], buf_.size(), 0, from, from_len);
......
......@@ -31,7 +31,7 @@
#include <dns/exceptions.h>
namespace ISC {
namespace isc {
// Abstraction of buffers for socket I/O. This is a tentative idea and should
// be revisited.
......@@ -84,7 +84,7 @@ public:
void write_uint16_at(uint16_t data, size_t pos)
{
if (pos + sizeof(data) >= buf_.size())
throw ISC::ISCBufferInvalidPosition();
throw isc::ISCBufferInvalidPosition();
data = htons(data);
uint8_t* cp = static_cast<uint8_t*>((void*)&data);
......
......@@ -21,14 +21,14 @@
// Quick hack exception classes for rapid prototyping. This shouldn't belong
// here. Also, exceptions should inherit from standard exception classes.
namespace ISC {
namespace isc {
class ISCException {};
class ISCUnexpected : public ISCException {};
class ISCNoSpace : public ISCException {};
class ISCInvalidAddressString : public ISCException {};
class ISCBufferInvalidPosition : public ISCException {};
namespace DNS {
namespace dns {
class DNSException {};
class DNSEmptyLabel : public DNSException {};
class DNSNameTooLong : public DNSException {};
......
......@@ -27,19 +27,19 @@
#include <dns/rrset.h>
#include <dns/message.h>
using ISC::DNS::Name;
using ISC::DNS::Message;
using ISC::DNS::RRType;
using ISC::DNS::RRClass;
using ISC::DNS::RRsetPtr;
using ISC::DNS::RR;
using ISC::DNS::TTL;
using isc::dns::Name;
using isc::dns::Message;
using isc::dns::RRType;
using isc::dns::RRClass;
using isc::dns::RRsetPtr;
using isc::dns::RR;
using isc::dns::TTL;
Message::Message()
{
initialize();
default_buffer_ = new ISC::SingleBuffer;
default_buffer_ = new isc::SingleBuffer;
buffer_ = default_buffer_;
default_compressor_ = new NameCompressor;
......
......@@ -29,8 +29,8 @@
#include <dns/name.h>
#include <dns/rrset.h>
namespace ISC {
namespace DNS {
namespace isc {
namespace dns {
typedef uint8_t rcode_t; // we actually only need 4 bits of it
typedef uint8_t opcode_t; // we actually only need 4 bits of it
typedef uint16_t flags_t;
......
......@@ -22,19 +22,19 @@
namespace {
using ISC::DNS::Name;
using ISC::DNS::RRClass;
using ISC::DNS::RRType;
using ISC::DNS::TTL;
using ISC::DNS::Rdata::IN::A;
using ISC::DNS::RRset;
using ISC::DNS::RRsetPtr;
using ISC::DNS::RR;
using ISC::DNS::Message;
using ISC::DNS::SECTION_QUESTION;
using ISC::DNS::SECTION_ANSWER;
using ISC::DNS::SECTION_AUTHORITY;
using ISC::DNS::SECTION_ADDITIONAL;
using isc::dns::Name;
using isc::dns::RRClass;
using isc::dns::RRType;
using isc::dns::TTL;
using isc::dns::Rdata::IN::A;
using isc::dns::RRset;
using isc::dns::RRsetPtr;
using isc::dns::RR;
using isc::dns::Message;
using isc::dns::SECTION_QUESTION;
using isc::dns::SECTION_ANSWER;
using isc::dns::SECTION_AUTHORITY;
using isc::dns::SECTION_ADDITIONAL;
// The fixture for testing class RRClass.
class MessageTest : public ::testing::Test {
......
......@@ -20,7 +20,7 @@
#include <dns/name.h>
using namespace std;
using namespace ISC::DNS;
using namespace isc::dns;
typedef enum {
ft_init = 0,
......
......@@ -22,8 +22,8 @@
#include <dns/name.h>
namespace ISC {
namespace DNS {
namespace isc {
namespace dns {
// Define them as an empty class for rapid prototyping
class NameCompressor {};
class NameDecompressor {};
......
......@@ -22,8 +22,8 @@
namespace {
using ISC::DNS::Name;
using ISC::DNS::DNSLabelTooLong;
using isc::dns::Name;
using isc::dns::DNSLabelTooLong;
// The fixture for testing class Name.
class NameTest : public ::testing::Test {
......@@ -31,7 +31,7 @@ protected:
NameTest()
{
example_name =
new ISC::DNS::Name("www.example.com");
new isc::dns::Name("www.example.com");
//01234567890123456 => length should be 17.
}
virtual ~NameTest()
......@@ -39,7 +39,7 @@ protected:
delete example_name;
}
ISC::DNS::Name *example_name;
isc::dns::Name *example_name;
};
TEST_F(NameTest, get_length)
......@@ -74,9 +74,9 @@ TEST_F(NameTest, operator_equals)
TEST_F(NameTest, to_from_wire)
{
ISC::SingleBuffer buffer;
ISC::DNS::NameCompressor compressor;
ISC::DNS::NameDecompressor decompressor;
isc::SingleBuffer buffer;
isc::dns::NameCompressor compressor;
isc::dns::NameDecompressor decompressor;
example_name->to_wire(buffer, compressor);
EXPECT_EQ(std::string("www.example.com."),
......
......@@ -25,16 +25,16 @@
#include <dns/buffer.h>
#include <dns/rrset.h>
using ISC::DNS::RRClass;
using ISC::DNS::RRType;
using ISC::DNS::TTL;
using ISC::DNS::Rdata::IN::A;
using ISC::DNS::Rdata::IN::AAAA;
using ISC::DNS::Rdata::Generic::NS;
using ISC::DNS::RRset;
using ISC::DNS::Rdata::Rdata;
using ISC::DNS::Question;
using ISC::DNS::RR;
using isc::dns::RRClass;
using isc::dns::RRType;
using isc::dns::TTL;
using isc::dns::Rdata::IN::A;
using isc::dns::Rdata::IN::AAAA;
using isc::dns::Rdata::Generic::NS;
using isc::dns::RRset;
using isc::dns::Rdata::Rdata;
using isc::dns::Question;
using isc::dns::RR;
RRClass::RRClass(const std::string& classstr)
{
......@@ -60,7 +60,7 @@ RRClass::to_text() const
}
void
RRClass::to_wire(ISC::Buffer& b) const
RRClass::to_wire(isc::Buffer& b) const
{
b.write_uint16(classval_);
}
......
......@@ -29,8 +29,8 @@
#include <dns/buffer.h>
#include <dns/name.h>
namespace ISC {
namespace DNS {
namespace isc {
namespace dns {
class Message;
class NameCompressor;
......
......@@ -21,17 +21,17 @@
namespace {
using ISC::DNS::Name;
using ISC::DNS::RRClass;
using ISC::DNS::RRType;
using ISC::DNS::TTL;
using ISC::DNS::Rdata::RDATAPTR;
using ISC::DNS::Rdata::IN::A;
using ISC::DNS::Rdata::IN::AAAA;
using ISC::DNS::Rdata::Generic::NS;
using ISC::DNS::RRset;
using ISC::DNS::RR;
using ISC::DNS::Question;
using isc::dns::Name;
using isc::dns::RRClass;
using isc::dns::RRType;
using isc::dns::TTL;
using isc::dns::Rdata::RDATAPTR;
using isc::dns::Rdata::IN::A;
using isc::dns::Rdata::IN::AAAA;
using isc::dns::Rdata::Generic::NS;
using isc::dns::RRset;
using isc::dns::RR;
using isc::dns::Question;
// The fixture for testing class RRClass.
class RRClassTest : public ::testing::Test {
......@@ -94,7 +94,7 @@ protected:
TEST_F(Rdata_IN_A_Test, from_to_text)
{
EXPECT_EQ("192.0.2.1", rdata.to_text());
EXPECT_THROW(A("2001:db8::1234"), ISC::ISCInvalidAddressString);
EXPECT_THROW(A("2001:db8::1234"), isc::ISCInvalidAddressString);
}
// The fixture for testing class IN/AAAA Rdata
......@@ -107,7 +107,7 @@ protected:
TEST_F(Rdata_IN_AAAA_Test, from_to_text)
{
EXPECT_EQ("2001:db8::abcd", rdata.to_text());
EXPECT_THROW(AAAA("192.0.2.255"), ISC::ISCInvalidAddressString);
EXPECT_THROW(AAAA("192.0.2.255"), isc::ISCInvalidAddressString);
}
// The fixture for testing class Generic/NS Rdata
......
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