diff --git a/OdbDesignLib/IOdbApp.h b/OdbDesignLib/IOdbApp.h index a7a2c7b6..e3941fa5 100644 --- a/OdbDesignLib/IOdbApp.h +++ b/OdbDesignLib/IOdbApp.h @@ -5,8 +5,6 @@ #include "ExitCode.h" #include "odbdesign_export.h" -using namespace Utils; - namespace Odb::Lib { class ODBDESIGN_EXPORT IOdbApp @@ -17,7 +15,7 @@ namespace Odb::Lib virtual const OdbDesignArgs& args() const = 0; virtual DesignCache& design_cache() = 0; - virtual ExitCode Run() = 0; + virtual Utils::ExitCode Run() = 0; protected: // abstract class/interface diff --git a/OdbDesignLib/IProtoBuffable.h b/OdbDesignLib/IProtoBuffable.h index afdd4c6f..2b5de625 100644 --- a/OdbDesignLib/IProtoBuffable.h +++ b/OdbDesignLib/IProtoBuffable.h @@ -6,9 +6,6 @@ #include "IJsonable.h" #include "odbdesign_export.h" -using namespace google::protobuf; -using namespace google::protobuf::util; - namespace Odb::Lib { @@ -29,7 +26,7 @@ namespace Odb::Lib {} // TMessage MUST derive from Message (must use this until template type contraints support is added) - static_assert(std::is_base_of::value, "template parameter type TPbMessage must derive from Protobuf Message class"); + static_assert(std::is_base_of::value, "template parameter type TPbMessage must derive from Protobuf Message class"); }; @@ -37,10 +34,10 @@ namespace Odb::Lib std::string IProtoBuffable::to_json() const { // use default options - JsonOptions jsonOptions; + google::protobuf::util::JsonOptions jsonOptions; std::string json; - auto status = MessageToJsonString(*to_protobuf(), &json, jsonOptions); + auto status = google::protobuf::util::MessageToJsonString(*to_protobuf(), &json, jsonOptions); if (!status.ok()) json.clear(); return json; } @@ -48,12 +45,12 @@ namespace Odb::Lib template inline void IProtoBuffable::from_json(const std::string& json) { - StringPiece sp_json(json); + google::protobuf::StringPiece sp_json(json); // use default options - JsonOptions jsonOptions; + google::protobuf::util::JsonOptions jsonOptions; auto pMessage = std::unique_ptr(); - auto status = JsonStringToMessage(sp_json, pMessage.get()); + auto status = google::protobuf::util::JsonStringToMessage(sp_json, pMessage.get()); if (!status.ok()) return; from_protobuf(*pMessage); } diff --git a/OdbDesignLib/MiscInfoFile.cpp b/OdbDesignLib/MiscInfoFile.cpp index 168f402c..8e4d6df6 100644 --- a/OdbDesignLib/MiscInfoFile.cpp +++ b/OdbDesignLib/MiscInfoFile.cpp @@ -11,6 +11,8 @@ #include "timestamp.h" #include "Logger.h" +using namespace std::chrono; + namespace Odb::Lib::FileModel::Design { bool MiscInfoFile::Parse(std::filesystem::path path) diff --git a/OdbDesignLib/MiscInfoFile.h b/OdbDesignLib/MiscInfoFile.h index 1545d7e2..cdd46a70 100644 --- a/OdbDesignLib/MiscInfoFile.h +++ b/OdbDesignLib/MiscInfoFile.h @@ -5,10 +5,7 @@ #include "OdbFile.h" #include -#ifndef ODBDESIGN_MISCINFOFILE_H -#define ODBDESIGN_MISCINFOFILE_H - -//using namespace std::chrono; +#pragma once namespace Odb::Lib::FileModel::Design { @@ -47,8 +44,4 @@ namespace Odb::Lib::FileModel::Design unsigned int m_maxUniqueId; }; - } - - -#endif //ODBDESIGN_MISCINFOFILE_H diff --git a/OdbDesignLib/OdbAppBase.h b/OdbDesignLib/OdbAppBase.h index a299a64c..e6fab74e 100644 --- a/OdbDesignLib/OdbAppBase.h +++ b/OdbDesignLib/OdbAppBase.h @@ -5,8 +5,6 @@ #include "OdbDesignArgs.h" #include "odbdesign_export.h" -using namespace Utils; - namespace Odb::Lib { class ODBDESIGN_EXPORT OdbAppBase : public virtual IOdbApp diff --git a/OdbDesignLib/OdbDesignArgs.h b/OdbDesignLib/OdbDesignArgs.h index a72f543e..4a20dba1 100644 --- a/OdbDesignLib/OdbDesignArgs.h +++ b/OdbDesignLib/OdbDesignArgs.h @@ -3,11 +3,9 @@ #include "CommandLineArgs.h" #include "odbdesign_export.h" -using namespace Utils; - namespace Odb::Lib { - class ODBDESIGN_EXPORT OdbDesignArgs : public CommandLineArgs + class ODBDESIGN_EXPORT OdbDesignArgs : public Utils::CommandLineArgs { public: OdbDesignArgs(int argc, char* argv[]); diff --git a/OdbDesignLib/OdbServerAppBase.cpp b/OdbDesignLib/OdbServerAppBase.cpp index 7e136c5e..ca671d2a 100644 --- a/OdbDesignLib/OdbServerAppBase.cpp +++ b/OdbDesignLib/OdbServerAppBase.cpp @@ -1,5 +1,6 @@ #include "OdbServerAppBase.h" +using namespace Utils; namespace Odb::Lib { diff --git a/OdbDesignLib/OdbServerAppBase.h b/OdbDesignLib/OdbServerAppBase.h index a0a9974c..2e5bdeaf 100644 --- a/OdbDesignLib/OdbServerAppBase.h +++ b/OdbDesignLib/OdbServerAppBase.h @@ -16,7 +16,7 @@ namespace Odb::Lib crow::SimpleApp& crow_app() override; - ExitCode Run() override; + Utils::ExitCode Run() override; protected: crow::SimpleApp m_crowApp; diff --git a/OdbDesignServer/Controllers/HelloWorldController.cpp b/OdbDesignServer/Controllers/HelloWorldController.cpp index 32f7da10..30d81207 100644 --- a/OdbDesignServer/Controllers/HelloWorldController.cpp +++ b/OdbDesignServer/Controllers/HelloWorldController.cpp @@ -1,6 +1,7 @@ #include "HelloWorldController.h" #include "../OdbDesignServerApp.h" +using namespace Odb::Lib; namespace Odb::App::Server { diff --git a/OdbDesignServer/Controllers/HelloWorldController.h b/OdbDesignServer/Controllers/HelloWorldController.h index 84263621..5fd94c08 100644 --- a/OdbDesignServer/Controllers/HelloWorldController.h +++ b/OdbDesignServer/Controllers/HelloWorldController.h @@ -3,14 +3,13 @@ #include "RouteController.h" #include "IOdbServerApp.h" -using namespace Odb::Lib; namespace Odb::App::Server { - class HelloWorldController : public RouteController + class HelloWorldController : public Odb::Lib::RouteController { public: - HelloWorldController(IOdbServerApp& serverApp); + HelloWorldController(Odb::Lib::IOdbServerApp& serverApp); void register_routes() override; diff --git a/OdbDesignServer/Controllers/StepsEdaDataController.h b/OdbDesignServer/Controllers/StepsEdaDataController.h index e24b8685..ae2815a3 100644 --- a/OdbDesignServer/Controllers/StepsEdaDataController.h +++ b/OdbDesignServer/Controllers/StepsEdaDataController.h @@ -4,14 +4,13 @@ #include "crow_win.h" #include "IOdbServerApp.h" -using namespace Odb::Lib; namespace Odb::App::Server { - class StepsEdaDataController : public RouteController + class StepsEdaDataController : public Odb::Lib::RouteController { public: - StepsEdaDataController(IOdbServerApp& serverApp); + StepsEdaDataController(Odb::Lib::IOdbServerApp& serverApp); void register_routes() override; diff --git a/OdbDesignServer/OdbDesignServerApp.h b/OdbDesignServer/OdbDesignServerApp.h index ae05e929..54e5fde9 100644 --- a/OdbDesignServer/OdbDesignServerApp.h +++ b/OdbDesignServer/OdbDesignServerApp.h @@ -3,11 +3,10 @@ #include "OdbDesignServer.h" #include "OdbServerAppBase.h" -using namespace Odb::Lib; namespace Odb::App::Server { - class OdbDesignServerApp : public OdbServerAppBase + class OdbDesignServerApp : public Odb::Lib::OdbServerAppBase { public: OdbDesignServerApp(int argc, char* argv[]); diff --git a/Utils/CommandLineArgs.cpp b/Utils/CommandLineArgs.cpp index db9b2f51..7ef3a725 100644 --- a/Utils/CommandLineArgs.cpp +++ b/Utils/CommandLineArgs.cpp @@ -63,7 +63,7 @@ namespace Utils void Utils::CommandLineArgs::parse() { - for (int i = 0; i < m_vecArguments.size(); i++) + for (std::size_t i = 0; i < m_vecArguments.size(); i++) { auto& arg = m_vecArguments[i]; if (arg.length() > 0) diff --git a/Utils/Logger.h b/Utils/Logger.h index 80adc409..fb3a0e75 100644 --- a/Utils/Logger.h +++ b/Utils/Logger.h @@ -4,9 +4,6 @@ #include #include "utils_export.h" -using namespace std::chrono; - - namespace Utils { @@ -42,7 +39,7 @@ namespace Utils { std::string message; Level level; - system_clock::time_point timeStamp; + std::chrono::system_clock::time_point timeStamp; std::string file; int line; diff --git a/Utils/timestamp.h b/Utils/timestamp.h index be0f25cc..13a6889f 100644 --- a/Utils/timestamp.h +++ b/Utils/timestamp.h @@ -8,13 +8,11 @@ #include #include "utils_export.h" -using namespace std::chrono; - namespace Utils { - std::string UTILS_EXPORT make_timestamp(const system_clock::time_point& timepoint); + std::string UTILS_EXPORT make_timestamp(const std::chrono::system_clock::time_point& timepoint); std::string UTILS_EXPORT make_timestamp(); - system_clock::time_point UTILS_EXPORT parse_timestamp(const std::string& timestamp, const std::string& format); + std::chrono::system_clock::time_point UTILS_EXPORT parse_timestamp(const std::string& timestamp, const std::string& format); }