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/name-component.hpp b/src/name-component.hpp
index 0e17580..a9be6a8 100644
--- a/src/name-component.hpp
+++ b/src/name-component.hpp
@@ -62,8 +62,8 @@
   /**
    * @brief Create name::Component from a wire block
    *
-   * @param wire Tlv::NameComponent Block from which to create name::Component
-   * @throws Error if wire.type() is not Tlv::NameComponent
+   * @param wire tlv::NameComponent Block from which to create name::Component
+   * @throws Error if wire.type() is not tlv::NameComponent
    *
    * Any block can be implicitly converted to name::Component
    */
@@ -74,7 +74,7 @@
    *
    * @param buffer A pointer to an immutable buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will not** allocate new memory for and copy the payload until
    * toWire() method is called.
    */
@@ -85,7 +85,7 @@
    * @brief Create a new name::Component from the buffer (data from buffer will be copied)
    * @param buffer A reference to the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -96,7 +96,7 @@
    * @param buffer     A pointer to the first byte of the buffer
    * @param bufferSize Size of the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   Component(const uint8_t* buffer, size_t bufferSize);
@@ -106,7 +106,7 @@
    * @param begin Iterator pointing to the beginning of the buffer
    * @param end   Iterator pointing to the ending of the buffer
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   template<class InputIterator>
@@ -118,7 +118,7 @@
    * @param str Zero-ended string.  Note that this string will be interpreted as is (i.e.,
    *            it will not be interpreted as URI)
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -130,7 +130,7 @@
    * @param str Const reference to STL string.  Note that this string will be interpreted
    *            as is (i.e., it will not be interpreted as URI)
    *
-   * This constructor will create a new Tlv::NameComponent Block with `buffer` as a payload.
+   * This constructor will create a new tlv::NameComponent Block with `buffer` as a payload.
    * Note that this method **will** allocate new memory for and copy the payload.
    */
   explicit
@@ -410,7 +410,7 @@
 
 inline
 Component::Component()
-  : Block(Tlv::NameComponent)
+  : Block(tlv::NameComponent)
 {
 }
 
@@ -418,44 +418,44 @@
 Component::Component(const Block& wire)
   : Block(wire)
 {
-  if (type() != Tlv::NameComponent)
+  if (type() != tlv::NameComponent)
     throw Error("Constructing name component from non name component TLV wire block");
 }
 
 inline
 Component::Component(const ConstBufferPtr& buffer)
-  : Block(Tlv::NameComponent, buffer)
+  : Block(tlv::NameComponent, buffer)
 {
 }
 
 inline
 Component::Component(const Buffer& value)
-  : Block(dataBlock(Tlv::NameComponent, value.buf(), value.size()))
+  : Block(dataBlock(tlv::NameComponent, value.buf(), value.size()))
 {
 }
 
 inline
 Component::Component(const uint8_t* value, size_t valueLen)
-  : Block(dataBlock(Tlv::NameComponent, value, valueLen))
+  : Block(dataBlock(tlv::NameComponent, value, valueLen))
 {
 }
 
 template<class InputIterator>
 inline
 Component::Component(InputIterator begin, InputIterator end)
-  : Block(dataBlock(Tlv::NameComponent, begin, end))
+  : Block(dataBlock(tlv::NameComponent, begin, end))
 {
 }
 
 inline
 Component::Component(const char* str)
-  : Block(dataBlock(Tlv::NameComponent, str, ::strlen(str)))
+  : Block(dataBlock(tlv::NameComponent, str, ::strlen(str)))
 {
 }
 
 inline
 Component::Component(const std::string& str)
-  : Block(dataBlock(Tlv::NameComponent, str.c_str(), str.size()))
+  : Block(dataBlock(tlv::NameComponent, str.c_str(), str.size()))
 {
 }
 
@@ -528,15 +528,15 @@
 inline Component
 Component::fromNumber(uint64_t number)
 {
-  /// \todo Change to Tlv::NumberComponent
-  return nonNegativeIntegerBlock(Tlv::NameComponent, number);
+  /// \todo Change to tlv::NumberComponent
+  return nonNegativeIntegerBlock(tlv::NameComponent, number);
 }
 
 
 inline uint64_t
 Component::toNumber() const
 {
-  /// \todo Check if Component is of Tlv::NumberComponent type
+  /// \todo Check if Component is of tlv::NumberComponent type
   return readNonNegativeInteger(static_cast<const Block&>(*this));
 }
 
@@ -592,7 +592,7 @@
   }
 
   totalLength += encoder.prependVarNumber(totalLength);
-  totalLength += encoder.prependVarNumber(Tlv::NameComponent);
+  totalLength += encoder.prependVarNumber(tlv::NameComponent);
 
   return encoder.block();
 }
@@ -606,7 +606,7 @@
   if (value_size() > 0)
     totalLength += block.prependByteArray(value(), value_size());
   totalLength += block.prependVarNumber(value_size());
-  totalLength += block.prependVarNumber(Tlv::NameComponent);
+  totalLength += block.prependVarNumber(tlv::NameComponent);
   return totalLength;
 }
 
@@ -629,7 +629,7 @@
 inline void
 Component::wireDecode(const Block& wire)
 {
-  if (wire.type() != Tlv::NameComponent)
+  if (wire.type() != tlv::NameComponent)
     throw Error("wireDecode name component from non name component TLV wire block");
 
   *this = wire;