code style: Don't use std:: inside .cpp files.
diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index 3e371c3..e7583e5 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -12,8 +12,9 @@
#include "../c/errors.h"
#include "../c/encoding/binary-xml-decoder.h"
-namespace ndn {
+using namespace std;
+namespace ndn {
/**
* A BinaryXmlDecoder extends a C ndn_BinaryXmlDecoder struct and wraps related functions.
@@ -40,7 +41,7 @@
int gotExpectedTag;
ndn_Error error;
if ((error = ndn_BinaryXmlDecoder_peekDTag(this, expectedTag, &gotExpectedTag)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return gotExpectedTag;
}
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index 9ffd72b..2707763 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -36,7 +36,7 @@
{
ndn_Error error;
if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return gotElementEnd();
}
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 9bd6759..b1f4007 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -41,7 +41,7 @@
BinaryXmlEncoder encoder;
ndn_Error error;
if ((error = ndn_encodeBinaryXmlInterest(&interestStruct, &encoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return encoder.getOutput();
}
@@ -59,7 +59,7 @@
BinaryXmlDecoder decoder(input, inputLength);
ndn_Error error;
if ((error = ndn_decodeBinaryXmlInterest(&interestStruct, &decoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
interest.set(interestStruct);
}
@@ -78,7 +78,7 @@
BinaryXmlEncoder encoder;
ndn_Error error;
if ((error = ndn_encodeBinaryXmlData(&dataStruct, signedPortionBeginOffset, signedPortionEndOffset, &encoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return encoder.getOutput();
}
@@ -97,7 +97,7 @@
BinaryXmlDecoder decoder(input, inputLength);
ndn_Error error;
if ((error = ndn_decodeBinaryXmlData(&dataStruct, signedPortionBeginOffset, signedPortionEndOffset, &decoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
data.set(dataStruct);
}
@@ -114,7 +114,7 @@
BinaryXmlEncoder encoder;
ndn_Error error;
if ((error = ndn_encodeBinaryXmlForwardingEntry(&forwardingEntryStruct, &encoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return encoder.getOutput();
}
@@ -130,7 +130,7 @@
BinaryXmlDecoder decoder(input, inputLength);
ndn_Error error;
if ((error = ndn_decodeBinaryXmlForwardingEntry(&forwardingEntryStruct, &decoder)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
forwardingEntry.set(forwardingEntryStruct);
}
diff --git a/ndn-cpp/encoding/der/der.cpp b/ndn-cpp/encoding/der/der.cpp
index 6d269c1..fc31161 100644
--- a/ndn-cpp/encoding/der/der.cpp
+++ b/ndn-cpp/encoding/der/der.cpp
@@ -297,7 +297,7 @@
DerNode::encodeHeader(payload_.size());
}
-DerByteString::DerByteString(const std::vector<uint8_t>& blob, DerType type)
+DerByteString::DerByteString(const vector<uint8_t>& blob, DerType type)
:DerNode(type)
{
payload_.insert(payload_.end(), blob.begin(), blob.end());
diff --git a/ndn-cpp/encoding/der/visitor/print-visitor.cpp b/ndn-cpp/encoding/der/visitor/print-visitor.cpp
index ab56b5d..cba5d2d 100644
--- a/ndn-cpp/encoding/der/visitor/print-visitor.cpp
+++ b/ndn-cpp/encoding/der/visitor/print-visitor.cpp
@@ -50,7 +50,7 @@
const string& indent = ndnboost::any_cast<const string&>(param);
printData(derBStr.getHeader(), indent);
- const std::vector<uint8_t>& payload = derBStr.getPayload();
+ const vector<uint8_t>& payload = derBStr.getPayload();
cout << indent << " " << " " << hex << setw(2) << setfill('0') << (int)(uint8_t)payload[0] << endl;
printData(payload, indent + " ", 1);
}
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 6f42635..22476af 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -119,7 +119,7 @@
ndn_Error error;
if ((error = ndn_NameComponent_toNumberWithMarker(&componentStruct, marker, &result)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
return result;
}
@@ -282,7 +282,7 @@
return *this;
}
-std::string
+string
Name::toUri() const
{
if (components_.size() == 0)
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 622d155..168d446 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -101,12 +101,12 @@
const uint8_t *derPointer = SELFREG_PRIVATE_KEY_DER;
RSA *privateKey = d2i_RSAPrivateKey(NULL, &derPointer, sizeof(SELFREG_PRIVATE_KEY_DER));
if (!privateKey)
- throw std::runtime_error("Error decoding private key in d2i_RSAPrivateKey");
+ throw runtime_error("Error decoding private key in d2i_RSAPrivateKey");
int success = RSA_sign(NID_sha256, signedPortionDigest, sizeof(signedPortionDigest), signatureBits, &signatureBitsLength, privateKey);
// Free the private key before checking for success.
RSA_free(privateKey);
if (!success)
- throw std::runtime_error("Error in RSA_sign");
+ throw runtime_error("Error in RSA_sign");
signature->setSignature(signatureBits, (size_t)signatureBitsLength);
}
diff --git a/ndn-cpp/security/certificate/certificate.cpp b/ndn-cpp/security/certificate/certificate.cpp
index 8f6288c..9047a70 100644
--- a/ndn-cpp/security/certificate/certificate.cpp
+++ b/ndn-cpp/security/certificate/certificate.cpp
@@ -102,7 +102,7 @@
root->encode(start);
- shared_ptr<std::vector<uint8_t> > blob = blobStream.buf();
+ shared_ptr<vector<uint8_t> > blob = blobStream.buf();
setContent(blob);
}
diff --git a/ndn-cpp/security/identity/identity-manager.cpp b/ndn-cpp/security/identity/identity-manager.cpp
index 3faf94b..e9c80bc 100644
--- a/ndn-cpp/security/identity/identity-manager.cpp
+++ b/ndn-cpp/security/identity/identity-manager.cpp
@@ -135,7 +135,7 @@
return certificate;
#else
- throw std::runtime_error("not implemented");
+ throw runtime_error("not implemented");
#endif
}
@@ -185,7 +185,7 @@
return sha256Sig;
#else
- throw std::runtime_error("not implemented");
+ throw runtime_error("not implemented");
#endif
}
@@ -265,7 +265,7 @@
return certificate;
#else
- throw std::runtime_error("not implemented");
+ throw runtime_error("not implemented");
#endif
}
diff --git a/ndn-cpp/security/identity/memory-identity-storage.cpp b/ndn-cpp/security/identity/memory-identity-storage.cpp
index 95ab69b..164862e 100644
--- a/ndn-cpp/security/identity/memory-identity-storage.cpp
+++ b/ndn-cpp/security/identity/memory-identity-storage.cpp
@@ -42,7 +42,7 @@
MemoryIdentityStorage::revokeIdentity()
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::revokeIdentity not implemented");
+ throw runtime_error("MemoryIdentityStorage::revokeIdentity not implemented");
#endif
}
@@ -50,7 +50,7 @@
MemoryIdentityStorage::getNewKeyName(const Name& identityName, bool useKsk)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::getNewKeyName not implemented");
+ throw runtime_error("MemoryIdentityStorage::getNewKeyName not implemented");
#endif
}
@@ -58,7 +58,7 @@
MemoryIdentityStorage::doesKeyExist(const Name& keyName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::doesKeyExist not implemented");
+ throw runtime_error("MemoryIdentityStorage::doesKeyExist not implemented");
#endif
}
@@ -79,7 +79,7 @@
MemoryIdentityStorage::addKey(const Name& keyName, KeyType keyType, const Blob& publicKeyDer)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::addKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::addKey not implemented");
#endif
}
@@ -87,7 +87,7 @@
MemoryIdentityStorage::getKey(const Name& keyName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::getKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::getKey not implemented");
#endif
}
@@ -95,7 +95,7 @@
MemoryIdentityStorage::activateKey(const Name& keyName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::activateKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::activateKey not implemented");
#endif
}
@@ -103,7 +103,7 @@
MemoryIdentityStorage::deactivateKey(const Name& keyName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::deactivateKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::deactivateKey not implemented");
#endif
}
@@ -111,7 +111,7 @@
MemoryIdentityStorage::doesCertificateExist(const Name& certificateName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::doesCertificateExist not implemented");
+ throw runtime_error("MemoryIdentityStorage::doesCertificateExist not implemented");
#endif
}
@@ -119,7 +119,7 @@
MemoryIdentityStorage::addCertificate(const IdentityCertificate& certificate)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::addCertificate not implemented");
+ throw runtime_error("MemoryIdentityStorage::addCertificate not implemented");
#endif
}
@@ -127,7 +127,7 @@
MemoryIdentityStorage::getCertificate(const Name &certificateName, bool allowAny)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::getCertificate not implemented");
+ throw runtime_error("MemoryIdentityStorage::getCertificate not implemented");
#endif
}
@@ -141,7 +141,7 @@
MemoryIdentityStorage::getDefaultKeyNameForIdentity(const Name& identityName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::getDefaultKeyNameForIdentity not implemented");
+ throw runtime_error("MemoryIdentityStorage::getDefaultKeyNameForIdentity not implemented");
#endif
}
@@ -149,7 +149,7 @@
MemoryIdentityStorage::getDefaultCertificateNameForKey(const Name& keyName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::getDefaultCertificateNameForKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::getDefaultCertificateNameForKey not implemented");
#endif
}
@@ -168,7 +168,7 @@
MemoryIdentityStorage::setDefaultKeyNameForIdentity(const Name& keyName, const Name& identityNameCheck)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::setDefaultKeyNameForIdentity not implemented");
+ throw runtime_error("MemoryIdentityStorage::setDefaultKeyNameForIdentity not implemented");
#endif
}
@@ -176,7 +176,7 @@
MemoryIdentityStorage::setDefaultCertificateNameForKey(const Name& keyName, const Name& certificateName)
{
#if 1
- throw std::runtime_error("MemoryIdentityStorage::setDefaultCertificateNameForKey not implemented");
+ throw runtime_error("MemoryIdentityStorage::setDefaultCertificateNameForKey not implemented");
#endif
}
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.cpp b/ndn-cpp/security/identity/memory-private-key-storage.cpp
index 09f1c66..f461a5b 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.cpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.cpp
@@ -33,7 +33,7 @@
MemoryPrivateKeyStorage::generateKeyPair(const Name& keyName, KeyType keyType, int keySize)
{
#if 1
- throw std::runtime_error("MemoryPrivateKeyStorage::generateKeyPair not implemented");
+ throw runtime_error("MemoryPrivateKeyStorage::generateKeyPair not implemented");
#endif
}
@@ -72,7 +72,7 @@
MemoryPrivateKeyStorage::decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
{
#if 1
- throw std::runtime_error("MemoryPrivateKeyStorage::decrypt not implemented");
+ throw runtime_error("MemoryPrivateKeyStorage::decrypt not implemented");
#endif
}
@@ -80,7 +80,7 @@
MemoryPrivateKeyStorage::encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
{
#if 1
- throw std::runtime_error("MemoryPrivateKeyStorage::encrypt not implemented");
+ throw runtime_error("MemoryPrivateKeyStorage::encrypt not implemented");
#endif
}
@@ -88,7 +88,7 @@
MemoryPrivateKeyStorage::generateKey(const Name& keyName, KeyType keyType, int keySize)
{
#if 1
- throw std::runtime_error("MemoryPrivateKeyStorage::generateKey not implemented");
+ throw runtime_error("MemoryPrivateKeyStorage::generateKey not implemented");
#endif
}
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index cb8c1e6..b1d4f0d 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -34,7 +34,7 @@
ndn_Error error;
if ((error = ndn_TcpTransport_connect(transport_.get(), (char *)tcpConnectionInfo.getHost().c_str(), tcpConnectionInfo.getPort())))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const size_t initialLength = 1000;
@@ -51,7 +51,7 @@
{
ndn_Error error;
if ((error = ndn_TcpTransport_send(transport_.get(), (uint8_t *)data, dataLength)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
}
void
@@ -60,14 +60,14 @@
int receiveIsReady;
ndn_Error error;
if ((error = ndn_TcpTransport_receiveIsReady(transport_.get(), &receiveIsReady)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
if (!receiveIsReady)
return;
uint8_t buffer[8000];
size_t nBytes;
if ((error = ndn_TcpTransport_receive(transport_.get(), buffer, sizeof(buffer), &nBytes)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
ndn_BinaryXmlElementReader_onReceivedData(elementReader_.get(), buffer, nBytes);
}
@@ -83,7 +83,7 @@
{
ndn_Error error;
if ((error = ndn_TcpTransport_close(transport_.get())))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
}
TcpTransport::~TcpTransport()
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index 17250d4..eb8b0d7 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -34,7 +34,7 @@
ndn_Error error;
if ((error = ndn_UdpTransport_connect(transport_.get(), (char *)udpConnectionInfo.getHost().c_str(), udpConnectionInfo.getPort())))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
// TODO: This belongs in the socket listener.
const size_t initialLength = 1000;
@@ -51,7 +51,7 @@
{
ndn_Error error;
if ((error = ndn_UdpTransport_send(transport_.get(), (uint8_t *)data, dataLength)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
}
void
@@ -60,14 +60,14 @@
int receiveIsReady;
ndn_Error error;
if ((error = ndn_UdpTransport_receiveIsReady(transport_.get(), &receiveIsReady)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
if (!receiveIsReady)
return;
uint8_t buffer[8000];
size_t nBytes;
if ((error = ndn_UdpTransport_receive(transport_.get(), buffer, sizeof(buffer), &nBytes)))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
ndn_BinaryXmlElementReader_onReceivedData(elementReader_.get(), buffer, nBytes);
}
@@ -83,7 +83,7 @@
{
ndn_Error error;
if ((error = ndn_UdpTransport_close(transport_.get())))
- throw std::runtime_error(ndn_getErrorString(error));
+ throw runtime_error(ndn_getErrorString(error));
}
UdpTransport::~UdpTransport()
diff --git a/ndn-cpp/util/blob.cpp b/ndn-cpp/util/blob.cpp
index 4ce9598..7d4e218 100644
--- a/ndn-cpp/util/blob.cpp
+++ b/ndn-cpp/util/blob.cpp
@@ -13,7 +13,7 @@
namespace ndn {
Blob::Blob(const struct ndn_Blob& blobStruct)
- : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(blobStruct.value, blobStruct.value + blobStruct.length))
+ : ptr_lib::shared_ptr<const vector<uint8_t> >(new vector<uint8_t>(blobStruct.value, blobStruct.value + blobStruct.length))
{
}