src: Improving consistency and correcting code style
As of this commit, all data structures can be directly constructed from
wire format.
This commit excludes full correction of code style in security/ and
tools/ndnsec*, which will be part of a different commit.
Change-Id: I121ac1f81948bc7468990df52cdefeb2988d91a1
Refs: #1403
diff --git a/src/encoding/buffer.hpp b/src/encoding/buffer.hpp
index a97edc1..0b9c327 100644
--- a/src/encoding/buffer.hpp
+++ b/src/encoding/buffer.hpp
@@ -50,7 +50,7 @@
* @param buf const pointer to buffer
* @param length length of the buffer to copy
*/
- Buffer(const void *buf, size_t length)
+ Buffer(const void* buf, size_t length)
: std::vector<uint8_t>(reinterpret_cast<const uint8_t*>(buf),
reinterpret_cast<const uint8_t*>(buf) + length)
{
@@ -69,7 +69,7 @@
: std::vector<uint8_t>(first, last)
{
}
-
+
/**
* @brief Get pointer to the first byte of the buffer
*/
@@ -126,7 +126,7 @@
get() const
{
return reinterpret_cast<const T*>(&front());
- }
+ }
};
/// @cond include_hidden
@@ -138,19 +138,19 @@
public:
typedef char char_type;
typedef boost::iostreams::sink_tag category;
-
+
buffer_append_device(Buffer& container)
: m_container(container)
{
}
-
+
std::streamsize
write(const char_type* s, std::streamsize n)
{
std::copy(s, s+n, std::back_inserter(m_container));
return n;
}
-
+
protected:
Buffer& m_container;
};