all: rename Tlv namespace to tlv for consistency
This commit renames the Tlv namespace defined in
tlv.hpp to tlv to be more consistent with tlv::security
and tlv::nfd. A Tlv namespace alias is provided for
backwards compatibility.
Change-Id: I21278d6a077afe7776802c3296997d4c1c44c6c6
diff --git a/src/management/nfd-channel-status.hpp b/src/management/nfd-channel-status.hpp
index ca746d7..78a2066 100644
--- a/src/management/nfd-channel-status.hpp
+++ b/src/management/nfd-channel-status.hpp
@@ -39,12 +39,12 @@
class ChannelStatus
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
diff --git a/src/management/nfd-control-parameters.hpp b/src/management/nfd-control-parameters.hpp
index b546d5e..82c08ad 100644
--- a/src/management/nfd-control-parameters.hpp
+++ b/src/management/nfd-control-parameters.hpp
@@ -72,12 +72,12 @@
class ControlParameters
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
@@ -471,7 +471,7 @@
m_wire.parse();
Block::element_const_iterator val;
- val = m_wire.find(Tlv::Name);
+ val = m_wire.find(tlv::Name);
m_hasFields[CONTROL_PARAMETER_NAME] = val != m_wire.elements_end();
if (this->hasName()) {
m_name.wireDecode(*val);
diff --git a/src/management/nfd-control-response.hpp b/src/management/nfd-control-response.hpp
index 5b78405..29aa832 100644
--- a/src/management/nfd-control-response.hpp
+++ b/src/management/nfd-control-response.hpp
@@ -38,12 +38,12 @@
class ControlResponse
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 8d82319..3b7056e 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -45,7 +45,7 @@
try {
response.wireDecode(data.getContent().blockFromValue());
}
- catch (ndn::Tlv::Error& e) {
+ catch (ndn::tlv::Error& e) {
if (static_cast<bool>(onFailure))
onFailure(serverErrorCode, e.what());
return;
@@ -63,7 +63,7 @@
try {
parameters.wireDecode(response.getBody());
}
- catch (ndn::Tlv::Error& e) {
+ catch (ndn::tlv::Error& e) {
if (static_cast<bool>(onFailure))
onFailure(serverErrorCode, e.what());
return;
diff --git a/src/management/nfd-face-event-notification.hpp b/src/management/nfd-face-event-notification.hpp
index 7afb852..a455e57 100644
--- a/src/management/nfd-face-event-notification.hpp
+++ b/src/management/nfd-face-event-notification.hpp
@@ -48,12 +48,12 @@
class FaceEventNotification : public FaceFlagsTraits<FaceEventNotification>
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
diff --git a/src/management/nfd-face-status.hpp b/src/management/nfd-face-status.hpp
index 1b33dea..eff9c83 100644
--- a/src/management/nfd-face-status.hpp
+++ b/src/management/nfd-face-status.hpp
@@ -41,12 +41,12 @@
class FaceStatus : public FaceFlagsTraits<FaceStatus>
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
diff --git a/src/management/nfd-fib-entry.hpp b/src/management/nfd-fib-entry.hpp
index 77b4369..1086707 100644
--- a/src/management/nfd-fib-entry.hpp
+++ b/src/management/nfd-fib-entry.hpp
@@ -42,10 +42,10 @@
class NextHopRecord
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
- Error(const std::string& what) : Tlv::Error(what) {}
+ Error(const std::string& what) : tlv::Error(what) {}
};
NextHopRecord()
@@ -189,10 +189,10 @@
class FibEntry
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
- Error(const std::string& what) : Tlv::Error(what)
+ Error(const std::string& what) : tlv::Error(what)
{
}
};
@@ -307,7 +307,7 @@
{
throw Error("Unexpected end of FibEntry");
}
- else if (val->type() != Tlv::Name)
+ else if (val->type() != tlv::Name)
{
std::stringstream error;
error << "Expected Name, but Block is of a different type: #"
diff --git a/src/management/nfd-forwarder-status.hpp b/src/management/nfd-forwarder-status.hpp
index 7dcf2a4..9ac58c4 100644
--- a/src/management/nfd-forwarder-status.hpp
+++ b/src/management/nfd-forwarder-status.hpp
@@ -39,12 +39,12 @@
class ForwarderStatus
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
@@ -314,7 +314,7 @@
m_nfdVersion);
totalLength += encoder.prependVarNumber(totalLength);
- totalLength += encoder.prependVarNumber(Tlv::Content);
+ totalLength += encoder.prependVarNumber(tlv::Content);
return totalLength;
}
@@ -337,7 +337,7 @@
inline void
ForwarderStatus::wireDecode(const Block& block)
{
- if (block.type() != Tlv::Content) {
+ if (block.type() != tlv::Content) {
throw Error("expecting Content block for Status payload");
}
m_wire = block;
diff --git a/src/management/nfd-rib-entry.cpp b/src/management/nfd-rib-entry.cpp
index d075cc6..f97fa66 100644
--- a/src/management/nfd-rib-entry.cpp
+++ b/src/management/nfd-rib-entry.cpp
@@ -266,7 +266,7 @@
Block::element_const_iterator val = m_wire.elements_begin();
- if (val != m_wire.elements_end() && val->type() == Tlv::Name) {
+ if (val != m_wire.elements_end() && val->type() == tlv::Name) {
m_prefix.wireDecode(*val);
++val;
}
diff --git a/src/management/nfd-rib-entry.hpp b/src/management/nfd-rib-entry.hpp
index 9ea84c2..738b8f5 100644
--- a/src/management/nfd-rib-entry.hpp
+++ b/src/management/nfd-rib-entry.hpp
@@ -52,11 +52,11 @@
class Route
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
- Error(const std::string& what) : Tlv::Error(what)
+ Error(const std::string& what) : tlv::Error(what)
{
}
};
@@ -187,10 +187,10 @@
class RibEntry
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
- Error(const std::string& what) : Tlv::Error(what)
+ Error(const std::string& what) : tlv::Error(what)
{
}
};
diff --git a/src/management/nfd-strategy-choice.hpp b/src/management/nfd-strategy-choice.hpp
index 531d1d1..2d9bbd5 100644
--- a/src/management/nfd-strategy-choice.hpp
+++ b/src/management/nfd-strategy-choice.hpp
@@ -38,12 +38,12 @@
class StrategyChoice
{
public:
- class Error : public Tlv::Error
+ class Error : public tlv::Error
{
public:
explicit
Error(const std::string& what)
- : Tlv::Error(what)
+ : tlv::Error(what)
{
}
};
@@ -145,7 +145,7 @@
m_wire.parse();
Block::element_const_iterator val = m_wire.elements_begin();
- if (val != m_wire.elements_end() && val->type() == Tlv::Name) {
+ if (val != m_wire.elements_end() && val->type() == tlv::Name) {
m_name.wireDecode(*val);
++val;
}