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/security/public-key.hpp b/src/security/public-key.hpp
index a332f02..8d6b7c5 100644
--- a/src/security/public-key.hpp
+++ b/src/security/public-key.hpp
@@ -18,8 +18,16 @@
 namespace ndn {
 
 class PublicKey {
-public:    
-  struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} };
+public:
+  class Error : public std::runtime_error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : std::runtime_error(what)
+    {
+    }
+  };
 
   /**
    * The default constructor.
@@ -49,36 +57,36 @@
   }
 
   void
-  encode(CryptoPP::BufferedTransformation &out) const;
+  encode(CryptoPP::BufferedTransformation& out) const;
 
   void
-  decode(CryptoPP::BufferedTransformation &in);
+  decode(CryptoPP::BufferedTransformation& in);
 
   // /*
   //  * Get the digest of the public key.
   //  * @param digestAlgorithm The digest algorithm. If omitted, use DIGEST_ALGORITHM_SHA256 by default.
   //  */
-  // Blob 
+  // Blob
   // getDigest(DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) const;
 
   inline bool
-  operator ==(const PublicKey &key) const
+  operator ==(const PublicKey& key) const
   {
     return key_ == key.key_;
   }
 
   inline bool
-  operator !=(const PublicKey &key) const
+  operator !=(const PublicKey& key) const
   {
     return key_ != key.key_;
   }
-  
+
 private:
   Buffer key_;
 };
 
-std::ostream &
-operator <<(std::ostream &os, const PublicKey &key);
+std::ostream&
+operator <<(std::ostream& os, const PublicKey& key);
 
 } // namespace ndn