From 3c9496233280b02f5a1e86e47d2262562141a951 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 21 May 2017 17:18:11 -0400 Subject: [PATCH] SignatureDB: Move two functions into the cpp file These are implementation details. --- .../Core/PowerPC/SignatureDB/SignatureDB.cpp | 22 ++++++++++--------- .../Core/PowerPC/SignatureDB/SignatureDB.h | 3 --- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp index d9582d99de..667d974d29 100644 --- a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp +++ b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.cpp @@ -18,15 +18,9 @@ #include "Core/PowerPC/SignatureDB/DSYSignatureDB.h" #include "Core/PowerPC/SignatureDB/MEGASignatureDB.h" -SignatureDB::SignatureDB(SignatureDB::HandlerType handler) : m_handler(CreateFormatHandler(handler)) +namespace { -} - -SignatureDB::SignatureDB(const std::string& file_path) : SignatureDB(GetHandlerType(file_path)) -{ -} - -SignatureDB::HandlerType SignatureDB::GetHandlerType(const std::string& file_path) +SignatureDB::HandlerType GetHandlerType(const std::string& file_path) { if (StringEndsWith(file_path, ".csv")) return SignatureDB::HandlerType::CSV; @@ -35,8 +29,7 @@ SignatureDB::HandlerType SignatureDB::GetHandlerType(const std::string& file_pat return SignatureDB::HandlerType::DSY; } -std::unique_ptr -SignatureDB::CreateFormatHandler(SignatureDB::HandlerType handler) const +std::unique_ptr CreateFormatHandler(SignatureDB::HandlerType handler) { switch (handler) { @@ -49,6 +42,15 @@ SignatureDB::CreateFormatHandler(SignatureDB::HandlerType handler) const return std::make_unique(); } } +} // Anonymous namespace + +SignatureDB::SignatureDB(SignatureDB::HandlerType handler) : m_handler(CreateFormatHandler(handler)) +{ +} + +SignatureDB::SignatureDB(const std::string& file_path) : SignatureDB(GetHandlerType(file_path)) +{ +} void SignatureDB::Clear() { diff --git a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h index 01277c9bd5..d3fb9b5b3b 100644 --- a/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h +++ b/Source/Core/Core/PowerPC/SignatureDB/SignatureDB.h @@ -27,8 +27,6 @@ public: explicit SignatureDB(HandlerType handler); explicit SignatureDB(const std::string& file_path); - static HandlerType GetHandlerType(const std::string& file_path); - void Clear(); // Does not clear. Remember to clear first if that's what you want. bool Load(const std::string& file_path); @@ -41,7 +39,6 @@ public: bool Add(u32 start_addr, u32 size, const std::string& name); private: - std::unique_ptr CreateFormatHandler(HandlerType handler) const; std::unique_ptr m_handler; };