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/exclude.hpp b/src/exclude.hpp
index c38e9f9..9fb5c3a 100644
--- a/src/exclude.hpp
+++ b/src/exclude.hpp
@@ -44,6 +44,15 @@
Exclude();
/**
+ * @brief Create from wire encoding
+ */
+ explicit
+ Exclude(const Block& wire)
+ {
+ wireDecode(wire);
+ }
+
+ /**
* @brief Fast encoding or block size estimation
*/
template<bool T>
@@ -245,7 +254,7 @@
inline size_t
Exclude::wireEncode(EncodingImpl<T>& block) const
{
- size_t total_len = 0;
+ size_t totalLength = 0;
// Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
// Any ::= ANY-TYPE TLV-LENGTH(=0)
@@ -254,17 +263,17 @@
{
if (i->second)
{
- total_len += prependBooleanBlock(block, Tlv::Any);
+ totalLength += prependBooleanBlock(block, Tlv::Any);
}
if (!i->first.empty())
{
- total_len += i->first.wireEncode(block);
+ totalLength += i->first.wireEncode(block);
}
}
- total_len += block.prependVarNumber(total_len);
- total_len += block.prependVarNumber(Tlv::Exclude);
- return total_len;
+ totalLength += block.prependVarNumber(totalLength);
+ totalLength += block.prependVarNumber(Tlv::Exclude);
+ return totalLength;
}
inline const Block&