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/cryptopp/asn_ext.hpp b/src/encoding/cryptopp/asn_ext.hpp
index 9140ed9..5d726dc 100644
--- a/src/encoding/cryptopp/asn_ext.hpp
+++ b/src/encoding/cryptopp/asn_ext.hpp
@@ -15,17 +15,28 @@
 
 namespace ndn {
 
-namespace Asn {
-struct Error : public std::runtime_error { Error(const std::string& what) : std::runtime_error(what) {} };
-}
+namespace asn {
+
+class Error : public std::runtime_error
+{
+public:
+  explicit
+  Error(const std::string& what)
+    : std::runtime_error(what)
+  {
+  }
+};
+
+} // namespace asn
 
 size_t
-DEREncodeGeneralTime(CryptoPP::BufferedTransformation& bt, const time::system_clock::TimePoint& time);
+DEREncodeGeneralTime(CryptoPP::BufferedTransformation& bt,
+                     const time::system_clock::TimePoint& time);
 
 void
-BERDecodeTime(CryptoPP::BufferedTransformation& bt, time::system_clock::TimePoint& time);
+BERDecodeTime(CryptoPP::BufferedTransformation& bt,
+              time::system_clock::TimePoint& time);
 
 } // namespace ndn
 
 #endif // NDN_ASN_EXT_HPP
-