diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-04-10 19:24:04 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-04-12 12:56:38 +0300 |
commit | c198137d69f40c5fe17a399c06e2d2934109d8b1 (patch) | |
tree | 360a96ced514727f05d49c7783155aae37a387fd /platform | |
parent | 1eb7a1d11626f1598dbd3c3bcab841e7a6cc4c40 (diff) |
[std] Use new include style for coding, fixes.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/file_logging.cpp | 8 | ||||
-rw-r--r-- | platform/file_logging.hpp | 5 | ||||
-rw-r--r-- | platform/platform_mac.mm | 26 | ||||
-rw-r--r-- | platform/platform_qt.cpp | 11 | ||||
-rw-r--r-- | platform/platform_tests/apk_test.cpp | 7 |
5 files changed, 36 insertions, 21 deletions
diff --git a/platform/file_logging.cpp b/platform/file_logging.cpp index 2c91137f13..e7a0131613 100644 --- a/platform/file_logging.cpp +++ b/platform/file_logging.cpp @@ -1,12 +1,14 @@ #include "platform/file_logging.hpp" -#include "std/mutex.hpp" +#include "platform/platform.hpp" #include "coding/file_writer.hpp" -#include "platform/platform.hpp" +#include <memory> +#include <mutex> +#include <sstream> -#include "std/sstream.hpp" +using namespace std; namespace { diff --git a/platform/file_logging.hpp b/platform/file_logging.hpp index 3465332ae4..67d12939d3 100644 --- a/platform/file_logging.hpp +++ b/platform/file_logging.hpp @@ -2,8 +2,7 @@ #include "base/logging.hpp" -#include "std/string.hpp" - +#include <string> // @todo this functionality is not located in logging.hpp since file_logging uses FileWriter which depends on coding lib. // At the same time loging is located in base and I do not want base depens on several more libs. @@ -19,7 +18,7 @@ // # define OMIM_ENABLE_LOG_MEMORY_INFO // #endif -void LogMessageFile(base::LogLevel level, base::SrcPoint const & srcPoint, string const & msg); +void LogMessageFile(base::LogLevel level, base::SrcPoint const & srcPoint, std::string const & msg); void LogMemoryInfo(); #ifdef OMIM_ENABLE_LOG_MEMORY_INFO diff --git a/platform/platform_mac.mm b/platform/platform_mac.mm index 8f353108db..87830f4189 100644 --- a/platform/platform_mac.mm +++ b/platform/platform_mac.mm @@ -6,6 +6,10 @@ #include "std/target_os.hpp" +#include <memory> +#include <string> +#include <utility> + #import "3party/Alohalytics/src/alohalytics_objc.h" #include <IOKit/IOKitLib.h> @@ -24,8 +28,8 @@ Platform::Platform() { // get resources directory path - string const resourcesPath = NSBundle.mainBundle.resourcePath.UTF8String; - string const bundlePath = NSBundle.mainBundle.bundlePath.UTF8String; + std::string const resourcesPath = NSBundle.mainBundle.resourcePath.UTF8String; + std::string const bundlePath = NSBundle.mainBundle.bundlePath.UTF8String; char const * envResourcesDir = ::getenv("MWM_RESOURCES_DIR"); char const * envWritableDir = ::getenv("MWM_WRITABLE_DIR"); @@ -45,7 +49,7 @@ Platform::Platform() if (!IsFileExistsByFullPath(m_resourcesDir)) { // Check development environment without symlink but with git repo - string const repoPath = bundlePath + "/../../../omim/data/"; + std::string const repoPath = bundlePath + "/../../../omim/data/"; if (IsFileExistsByFullPath(repoPath)) m_resourcesDir = repoPath; else @@ -104,7 +108,7 @@ Platform::Platform() m_tmpDir = tempDir.UTF8String; m_tmpDir += '/'; - m_guiThread = make_unique<platform::GuiThread>(); + m_guiThread = std::make_unique<platform::GuiThread>(); LOG(LDEBUG, ("Resources Directory:", m_resourcesDir)); LOG(LDEBUG, ("Writable Directory:", m_writableDir)); @@ -112,26 +116,26 @@ Platform::Platform() LOG(LDEBUG, ("Settings Directory:", m_settingsDir)); } -string Platform::UniqueClientId() const { return [Alohalytics installationId].UTF8String; } +std::string Platform::UniqueClientId() const { return [Alohalytics installationId].UTF8String; } -string Platform::AdvertisingId() const +std::string Platform::AdvertisingId() const { return {}; } -string Platform::MacAddress(bool md5Decoded) const +std::string Platform::MacAddress(bool md5Decoded) const { // Not implemented. UNUSED_VALUE(md5Decoded); return {}; } -string Platform::DeviceName() const +std::string Platform::DeviceName() const { return OMIM_OS_NAME; } -string Platform::DeviceModel() const +std::string Platform::DeviceModel() const { return {}; } @@ -180,8 +184,8 @@ uint8_t Platform::GetBatteryLevel() return 100; } -void Platform::SetGuiThread(unique_ptr<base::TaskLoop> guiThread) +void Platform::SetGuiThread(std::unique_ptr<base::TaskLoop> guiThread) { - m_guiThread = move(guiThread); + m_guiThread = std::move(guiThread); } diff --git a/platform/platform_qt.cpp b/platform/platform_qt.cpp index b84e5b97d6..424965725a 100644 --- a/platform/platform_qt.cpp +++ b/platform/platform_qt.cpp @@ -7,16 +7,21 @@ #include "base/logging.hpp" -#include "std/algorithm.hpp" -#include "std/future.hpp" -#include "std/regex.hpp" #include "std/target_os.hpp" +#include <algorithm> +#include <future> +#include <memory> +#include <regex> +#include <string> + #include <QtCore/QCoreApplication> #include <QtCore/QDir> #include <QtCore/QFileInfo> #include <QtCore/QLocale> +using namespace std; + unique_ptr<ModelReader> Platform::GetReader(string const & file, string const & searchScope) const { return make_unique<FileReader>(ReadPathForFile(file, searchScope), diff --git a/platform/platform_tests/apk_test.cpp b/platform/platform_tests/apk_test.cpp index 76f9094a50..c2b5dfa37e 100644 --- a/platform/platform_tests/apk_test.cpp +++ b/platform/platform_tests/apk_test.cpp @@ -9,7 +9,12 @@ #include "base/thread_pool.hpp" #include "base/logging.hpp" -#include "std/numeric.hpp" +#include <cstdint> +#include <memory> +#include <numeric> +#include <string> + +using namespace std; namespace { |