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/identity-certificate.hpp b/src/security/identity-certificate.hpp
index 6d6d334..01427d4 100644
--- a/src/security/identity-certificate.hpp
+++ b/src/security/identity-certificate.hpp
@@ -17,7 +17,15 @@
class IdentityCertificate : public Certificate
{
public:
- struct Error : public std::runtime_error { Error(const std::string &what) : std::runtime_error(what) {} };
+ class Error : public std::runtime_error
+ {
+ public:
+ explicit
+ Error(const std::string& what)
+ : std::runtime_error(what)
+ {
+ }
+ };
/**
* The default constructor.
@@ -33,20 +41,20 @@
*/
inline
IdentityCertificate(const Data& data);
-
+
/**
* The virtual destructor.
*/
- inline virtual
+ inline virtual
~IdentityCertificate();
-
- inline void
- wireDecode(const Block &wire);
inline void
- setName(const Name &name);
-
- inline const Name &
+ wireDecode(const Block& wire);
+
+ inline void
+ setName(const Name& name);
+
+ inline const Name&
getPublicKeyName () const;
static bool
@@ -59,14 +67,14 @@
*/
static Name
certificateNameToPublicKeyName(const Name& certificateName);
-
+
private:
static bool
isCorrectName(const Name& name);
-
+
void
setPublicKeyName();
-
+
protected:
Name publicKeyName_;
};
@@ -82,27 +90,27 @@
{
setPublicKeyName();
}
-
+
inline
IdentityCertificate::~IdentityCertificate()
{
}
inline void
-IdentityCertificate::wireDecode(const Block &wire)
+IdentityCertificate::wireDecode(const Block& wire)
{
Certificate::wireDecode(wire);
setPublicKeyName();
}
inline void
-IdentityCertificate::setName(const Name &name)
+IdentityCertificate::setName(const Name& name)
{
Certificate::setName(name);
setPublicKeyName();
}
-inline const Name &
+inline const Name&
IdentityCertificate::getPublicKeyName () const
{
return publicKeyName_;