aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAntony Woods <acron1@gmail.com>2014-10-22 09:34:30 +0100
committerAntony Woods <acron1@gmail.com>2014-10-22 09:34:30 +0100
commit3a2d22dfe068553931ae86d0477eac3d07aa4668 (patch)
treead653d7e1f09d0e5b38d93e80ae2d3fdab2d52f7 /include
parent6a2def410cc2559aeb7a9d34821b5d195672fb3b (diff)
downloadcrow-3a2d22dfe068553931ae86d0477eac3d07aa4668.tar.gz
crow-3a2d22dfe068553931ae86d0477eac3d07aa4668.zip
Removed instance of 'using namespace std'
Diffstat (limited to 'include')
-rw-r--r--include/logging.h14
-rw-r--r--include/query_string.h8
2 files changed, 9 insertions, 13 deletions
diff --git a/include/logging.h b/include/logging.h
index 8f5b833..ad1f4bc 100644
--- a/include/logging.h
+++ b/include/logging.h
@@ -9,8 +9,6 @@
#include "settings.h"
-using namespace std;
-
namespace crow
{
enum class LogLevel
@@ -24,12 +22,12 @@ namespace crow
class ILogHandler {
public:
- virtual void log(string message, LogLevel level) = 0;
+ virtual void log(std::string message, LogLevel level) = 0;
};
class CerrLogHandler : public ILogHandler {
public:
- void log(string message, LogLevel level) override {
+ void log(std::string message, LogLevel level) override {
cerr << message;
}
};
@@ -38,18 +36,18 @@ namespace crow
private:
//
- static string timestamp()
+ static std::string timestamp()
{
char date[32];
time_t t = time(0);
strftime(date, sizeof(date), "%Y-%m-%d %H:%M:%S", gmtime(&t));
- return string(date);
+ return std::string(date);
}
public:
- logger(string prefix, LogLevel level) : level_(level) {
+ logger(std::string prefix, LogLevel level) : level_(level) {
#ifdef CROW_ENABLE_LOGGING
stringstream_ << "(" << timestamp() << ") [" << prefix << "] ";
#endif
@@ -104,7 +102,7 @@ namespace crow
}
//
- ostringstream stringstream_;
+ std::ostringstream stringstream_;
LogLevel level_;
};
}
diff --git a/include/query_string.h b/include/query_string.h
index 5a42782..afc112e 100644
--- a/include/query_string.h
+++ b/include/query_string.h
@@ -3,8 +3,6 @@
#include <stdio.h>
#include <string>
-using namespace std;
-
// ----------------------------------------------------------------------------
// qs_parse (modified)
// https://github.com/bartgrantham/qs_parse
@@ -273,16 +271,16 @@ namespace crow
}
- char* get (const string name) const
+ char* get (const std::string name) const
{
char* ret = qs_k2v(name.c_str(), _kv_pairs, _kv_size);
return ret != 0 ? ret : nullptr;
}
- vector<char*> get_list (const string name) const
+ vector<char*> get_list (const std::string name) const
{
vector<char*> ret;
- string plus = name + "[]";
+ std::string plus = name + "[]";
char* tmp = nullptr;
int count = 0;
do