diff --git a/3party/jansson/jansson_handle.hpp b/3party/jansson/jansson_handle.hpp index 565c532..b6ba745 100644 --- a/3party/jansson/jansson_handle.hpp +++ b/3party/jansson/jansson_handle.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/algorithm.hpp" +#include struct json_struct_t; @@ -36,7 +36,7 @@ public: void swap(JsonHandle & json) { - ::swap(m_pJson, json.m_pJson); + std::swap(m_pJson, json.m_pJson); } json_struct_t * get() const diff --git a/coding/dd_vector.hpp b/coding/dd_vector.hpp index 0f65a5a..a196dd8 100644 --- a/coding/dd_vector.hpp +++ b/coding/dd_vector.hpp @@ -1,13 +1,14 @@ #pragma once + #include "coding/reader.hpp" #include "base/assert.hpp" #include "base/exception.hpp" -#include "std/iterator_facade.hpp" - #include +#include + // Disk-driven vector. template class DDVector @@ -43,10 +44,10 @@ public: return ReadPrimitiveFromPos(m_reader, static_cast(i) * sizeof(T)); } - class const_iterator : public iterator_facade< + class const_iterator : public boost::iterator_facade< const_iterator, value_type const, - random_access_traversal_tag> + boost::random_access_traversal_tag> { public: const_iterator() : m_pReader(NULL), m_I(0), m_bValueRead(false) @@ -144,7 +145,6 @@ public: #else return const_iterator(&m_reader, m_Size); #endif - } void Read(size_type i, T & result) const diff --git a/coding/reader.hpp b/coding/reader.hpp index 9c99e88..3bd94fe 100644 --- a/coding/reader.hpp +++ b/coding/reader.hpp @@ -5,8 +5,6 @@ #include "base/assert.hpp" #include "base/exception.hpp" -#include "std/shared_array.hpp" - #include #include #include diff --git a/generator/check_model.cpp b/generator/check_model.cpp index 53fc57a..95ba953 100644 --- a/generator/check_model.cpp +++ b/generator/check_model.cpp @@ -8,6 +8,7 @@ #include "base/logging.hpp" +#include using namespace feature; @@ -20,7 +21,7 @@ namespace check_model FeaturesVectorTest(fName).GetVector().ForEach([&](FeatureType & ft, uint32_t) { TypesHolder types(ft); - vector vTypes; + std::vector vTypes; for (uint32_t t : types) { CHECK_EQUAL(c.GetTypeForIndex(c.GetIndexForType(t)), t, ()); diff --git a/generator/coastlines_generator.hpp b/generator/coastlines_generator.hpp index e7f633a..c1596d3 100644 --- a/generator/coastlines_generator.hpp +++ b/generator/coastlines_generator.hpp @@ -7,6 +7,7 @@ #include "geometry/tree4d.hpp" #include "geometry/region2d.hpp" +#include namespace feature { @@ -30,5 +31,5 @@ public: /// @return false if coasts are not merged and FLAG_fail_on_coasts is set bool Finish(); - void GetFeatures(vector & vecFb); + void GetFeatures(std::vector & vecFb); }; diff --git a/generator/generator_tests/common.cpp b/generator/generator_tests/common.cpp index d991164..da0793b 100644 --- a/generator/generator_tests/common.cpp +++ b/generator/generator_tests/common.cpp @@ -58,7 +58,7 @@ feature::FeatureBuilder FeatureBuilderFromOmsElementData(OsmElementData const & { auto const & p1 = elementData.m_polygon[0]; auto const & p2 = elementData.m_polygon[1]; - vector poly = { + std::vector poly = { {p1.x, p1.y}, {p1.x, p2.y}, {p2.x, p2.y}, {p2.x, p1.y}, {p1.x, p1.y}}; fb.AddPolygon(poly); fb.SetHoles({}); diff --git a/generator/raw_generator.cpp b/generator/raw_generator.cpp index c755660..5e7cd62 100644 --- a/generator/raw_generator.cpp +++ b/generator/raw_generator.cpp @@ -10,6 +10,11 @@ #include "defines.hpp" +#include +#include + +using namespace std; + namespace generator { RawGenerator::RawGenerator(feature::GenerateInfo & genInfo, size_t threadsCount, size_t chunkSize) diff --git a/generator/regions/regions_builder.cpp b/generator/regions/regions_builder.cpp index eb2ba30..197ed88 100644 --- a/generator/regions/regions_builder.cpp +++ b/generator/regions/regions_builder.cpp @@ -9,8 +9,6 @@ #include "base/string_utils.hpp" #include "base/thread_pool_computational.hpp" -#include "std/unordered_map.hpp" - #include #include #include diff --git a/geocoder/house_numbers_matcher.cpp b/geocoder/house_numbers_matcher.cpp index 1e85c88..b1f926c 100644 --- a/geocoder/house_numbers_matcher.cpp +++ b/geocoder/house_numbers_matcher.cpp @@ -9,7 +9,9 @@ #include #include -#include "std/transform_iterator.hpp" +#include + +using boost::make_transform_iterator; using namespace std; using namespace strings; diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index eee3a41..0c714b1 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -13,6 +13,7 @@ #include "base/base.hpp" #include "base/control_flow.hpp" +#include #include #include diff --git a/indexer/feature_utils.hpp b/indexer/feature_utils.hpp index 719fa90..dea7158 100644 --- a/indexer/feature_utils.hpp +++ b/indexer/feature_utils.hpp @@ -4,6 +4,7 @@ #include "base/base.hpp" +#include #include struct FeatureID; @@ -33,7 +34,7 @@ namespace feature /// In case when primary name is empty it will be propagated from secondary and secondary will be /// cleared. In case when primary name contains secondary name then secondary will be cleared. void GetPreferredNames(RegionData const & regionData, StringUtf8Multilang const & src, - int8_t const deviceLang, bool allowTranslit, string & primary, string & secondary); + int8_t const deviceLang, bool allowTranslit, std::string & primary, std::string & secondary); /// When MWM contains user's language (or similar to device languages if provided), /// the priority is the following: @@ -54,7 +55,7 @@ namespace feature /// - default name; /// - country language name. void GetReadableName(RegionData const & regionData, StringUtf8Multilang const & src, - int8_t const deviceLang, bool allowTranslit, string & out); + int8_t const deviceLang, bool allowTranslit, std::string & out); /// Returns language id as return result and name for search on booking in the @name parameter, /// the priority is the following: @@ -62,10 +63,10 @@ namespace feature /// - country language name; /// - english name. int8_t GetNameForSearchOnBooking(RegionData const & regionData, StringUtf8Multilang const & src, - string & name); + std::string & name); /// Returns preferred name when only the device language is available. - bool GetPreferredName(StringUtf8Multilang const & src, int8_t deviceLang, string & out); + bool GetPreferredName(StringUtf8Multilang const & src, int8_t deviceLang, std::string & out); /// Returns priority list of language codes for feature description, /// the priority is the following: diff --git a/indexer/features_vector.cpp b/indexer/features_vector.cpp index 646b178..9f7d4ac 100644 --- a/indexer/features_vector.cpp +++ b/indexer/features_vector.cpp @@ -5,6 +5,8 @@ #include "platform/constants.hpp" #include "platform/mwm_version.hpp" +#include + std::unique_ptr FeaturesVector::GetByIndex(uint32_t index) const { uint32_t offset = 0, size = 0; @@ -18,7 +20,7 @@ size_t FeaturesVector::GetNumFeatures() const return m_table ? m_table->size() : 0; } -FeaturesVectorTest::FeaturesVectorTest(string const & filePath) +FeaturesVectorTest::FeaturesVectorTest(std::string const & filePath) : FeaturesVectorTest((FilesContainerR(filePath, READER_CHUNK_LOG_SIZE, READER_CHUNK_LOG_COUNT))) { } diff --git a/indexer/features_vector.hpp b/indexer/features_vector.hpp index e0750f7..1414780 100644 --- a/indexer/features_vector.hpp +++ b/indexer/features_vector.hpp @@ -72,7 +72,7 @@ class FeaturesVectorTest FeaturesVector m_vector; public: - explicit FeaturesVectorTest(string const & filePath); + explicit FeaturesVectorTest(std::string const & filePath); explicit FeaturesVectorTest(FilesContainerR const & cont); ~FeaturesVectorTest(); diff --git a/indexer/index_builder.cpp b/indexer/index_builder.cpp index b1a4428..9078816 100644 --- a/indexer/index_builder.cpp +++ b/indexer/index_builder.cpp @@ -5,14 +5,15 @@ #include "base/logging.hpp" +#include namespace indexer { - bool BuildIndexFromDataFile(string const & datFile, string const & tmpFile) + bool BuildIndexFromDataFile(std::string const & datFile, std::string const & tmpFile) { try { - string const idxFileName(tmpFile + GEOM_INDEX_TMP_EXT); + std::string const idxFileName(tmpFile + GEOM_INDEX_TMP_EXT); { FeaturesVectorTest features(datFile); FileWriter writer(idxFileName); diff --git a/indexer/index_builder.hpp b/indexer/index_builder.hpp index 1ac1ee7..27d7072 100644 --- a/indexer/index_builder.hpp +++ b/indexer/index_builder.hpp @@ -3,11 +3,13 @@ #include "indexer/data_header.hpp" #include "indexer/scale_index_builder.hpp" +#include + namespace indexer { template void BuildIndex(feature::DataHeader const & header, TFeaturesVector const & features, - TWriter & writer, string const & tmpFilePrefix) + TWriter & writer, std::string const & tmpFilePrefix) { LOG(LINFO, ("Building scale index.")); uint64_t indexSize; @@ -20,5 +22,5 @@ void BuildIndex(feature::DataHeader const & header, TFeaturesVector const & feat } // doesn't throw exceptions - bool BuildIndexFromDataFile(string const & datFile, string const & tmpFile); + bool BuildIndexFromDataFile(std::string const & datFile, std::string const & tmpFile); } diff --git a/indexer/road_shields_parser.cpp b/indexer/road_shields_parser.cpp index c6988c8..f7aa9de 100644 --- a/indexer/road_shields_parser.cpp +++ b/indexer/road_shields_parser.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -292,7 +293,7 @@ class SimpleUnicodeRoadShieldParser : public RoadShieldParser public: struct Name { - Name(std::string const & simpleName, string const & unicodeName) + Name(std::string const & simpleName, std::string const & unicodeName) : m_simpleName(simpleName), m_unicodeName(strings::MakeUniString(unicodeName)) { } @@ -591,7 +592,7 @@ std::string DebugPrint(RoadShieldType shieldType) case RoadShieldType::Hidden: return "hidden"; case RoadShieldType::Count: CHECK(false, ("RoadShieldType::Count is not to be used as a type")); } - return string(); + return std::string(); } std::string DebugPrint(RoadShield const & shield) diff --git a/platform/constants.hpp b/platform/constants.hpp index 442fa8f..d465b5a 100644 --- a/platform/constants.hpp +++ b/platform/constants.hpp @@ -1,6 +1,6 @@ #pragma once -#include "std/cstdint.hpp" +#include static const uint32_t READER_CHUNK_LOG_SIZE = 10; static const uint32_t READER_CHUNK_LOG_COUNT = 12; diff --git a/platform/country_file.cpp b/platform/country_file.cpp index d50e2d0..9b64730 100644 --- a/platform/country_file.cpp +++ b/platform/country_file.cpp @@ -1,11 +1,14 @@ #include "platform/country_file.hpp" -#include "platform/mwm_version.hpp" -#include "defines.hpp" +#include "platform/mwm_version.hpp" #include "base/assert.hpp" -#include "std/sstream.hpp" +#include + +#include "defines.hpp" + +using namespace std; namespace { @@ -27,7 +30,7 @@ string GetNameWithExt(string const & countryFile, MapOptions file) return string(); } } -} // namespace +} // namespace namespace platform { diff --git a/platform/country_file.hpp b/platform/country_file.hpp index 9051f34..c1b575d 100644 --- a/platform/country_file.hpp +++ b/platform/country_file.hpp @@ -1,7 +1,9 @@ #pragma once #include "platform/country_defines.hpp" -#include "std/string.hpp" + +#include +#include namespace platform { @@ -14,31 +16,31 @@ class CountryFile { public: CountryFile(); - explicit CountryFile(string const & name); + explicit CountryFile(std::string const & name); /// \returns file name without extensions. - string const & GetName() const; + std::string const & GetName() const; /// \note Remote size is size of mwm in bytes. This mwm contains routing and map sections. void SetRemoteSizes(MwmSize mapSize, MwmSize routingSize); MwmSize GetRemoteSize(MapOptions file) const; - void SetSha1(string const & base64Sha1) { m_sha1 = base64Sha1; } - string const & GetSha1() const { return m_sha1; } + void SetSha1(std::string const & base64Sha1) { m_sha1 = base64Sha1; } + std::string const & GetSha1() const { return m_sha1; } inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; } inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; } inline bool operator!=(const CountryFile & rhs) const { return !(*this == rhs); } private: - friend string DebugPrint(CountryFile const & file); + friend std::string DebugPrint(CountryFile const & file); /// Base name (without any extensions) of the file. Same as id of country/region. - string m_name; + std::string m_name; MwmSize m_mapSize = 0; MwmSize m_routingSize = 0; /// \note SHA1 is encoded to base64. - string m_sha1; + std::string m_sha1; }; /// \returns This method returns file name with extension. For example Abkhazia.mwm or @@ -46,6 +48,6 @@ private: /// \param countryFile is a file name without extension. For example Abkhazia. /// \param file is type of map data. /// \param version is version of mwm. For example 160731. -string GetFileName(string const & countryFile, MapOptions file, int64_t version); -string DebugPrint(CountryFile const & file); +std::string GetFileName(std::string const & countryFile, MapOptions file, int64_t version); +std::string DebugPrint(CountryFile const & file); } // namespace platform diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp index f9cc45a..1c56b4b 100644 --- a/platform/local_country_file.cpp +++ b/platform/local_country_file.cpp @@ -1,4 +1,5 @@ #include "platform/local_country_file.hpp" + #include "platform/mwm_version.hpp" #include "platform/platform.hpp" @@ -8,8 +9,9 @@ #include "base/file_name_utils.hpp" #include "base/logging.hpp" -#include "std/sstream.hpp" +#include +using namespace std; namespace platform { diff --git a/platform/local_country_file.hpp b/platform/local_country_file.hpp index c64f780..e290efd 100644 --- a/platform/local_country_file.hpp +++ b/platform/local_country_file.hpp @@ -3,8 +3,9 @@ #include "platform/country_file.hpp" #include "platform/country_defines.hpp" -#include "std/string.hpp" -#include "std/vector.hpp" +#include +#include +#include namespace platform { @@ -32,7 +33,7 @@ public: // directory. Note that no disk operations are not performed until // SyncWithDisk() is called. // The directory must contain a full path to the country file. - LocalCountryFile(string const & directory, CountryFile const & countryFile, int64_t version); + LocalCountryFile(std::string const & directory, CountryFile const & countryFile, int64_t version); // Syncs internal state like availability of map and routing files, // their sizes etc. with disk. @@ -48,7 +49,7 @@ public: // Returns path to a file. Return value may be empty until // SyncWithDisk() is called. - string GetPath(MapOptions file) const; + std::string GetPath(MapOptions file) const; // Returns size of a file. Return value may be zero until // SyncWithDisk() is called. @@ -66,8 +67,8 @@ public: static_cast(filesMask); } - string const & GetDirectory() const { return m_directory; } - string const & GetCountryName() const { return m_countryFile.GetName(); } + std::string const & GetDirectory() const { return m_directory; } + std::string const & GetCountryName() const { return m_countryFile.GetName(); } int64_t GetVersion() const { return m_version; } CountryFile const & GetCountryFile() const { return m_countryFile; } CountryFile & GetCountryFile() { return m_countryFile; } @@ -81,21 +82,21 @@ public: // Creates LocalCountryFile for test purposes, for a country region // with countryFileName (without any extensions). Automatically // performs sync with disk. - static LocalCountryFile MakeForTesting(string const & countryFileName, int64_t version = 0); + static LocalCountryFile MakeForTesting(std::string const & countryFileName, int64_t version = 0); /// @todo The easiest solution for now. Need to be removed in future. /// @param fullPath Full path to the mwm file. - static LocalCountryFile MakeTemporary(string const & fullPath); + static LocalCountryFile MakeTemporary(std::string const & fullPath); private: - friend string DebugPrint(LocalCountryFile const &); + friend std::string DebugPrint(LocalCountryFile const &); friend void UnitTest_LocalCountryFile_DirectoryLookup(); friend void FindAllLocalMapsAndCleanup(int64_t latestVersion, - string const & dataDir, vector & localFiles); + std::string const & dataDir, std::vector & localFiles); /// @note! If directory is empty, the file is stored in resources. /// In this case, the only valid params are m_countryFile and m_version. - string m_directory; + std::string m_directory; CountryFile m_countryFile; int64_t m_version; @@ -109,5 +110,5 @@ private: uint64_t m_routingSize; }; -string DebugPrint(LocalCountryFile const & file); +std::string DebugPrint(LocalCountryFile const & file); } // namespace platform diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp index bc3b1bf..bfdb529 100644 --- a/platform/local_country_file_utils.cpp +++ b/platform/local_country_file_utils.cpp @@ -13,15 +13,17 @@ #include "base/logging.hpp" #include "base/string_utils.hpp" -#include "std/algorithm.hpp" -#include "std/cctype.hpp" -#include "std/regex.hpp" -#include "std/sstream.hpp" -#include "std/unique_ptr.hpp" -#include "std/unordered_set.hpp" +#include +#include +#include +#include +#include +#include #include "defines.hpp" +using namespace std; + namespace platform { namespace migrate diff --git a/platform/local_country_file_utils.hpp b/platform/local_country_file_utils.hpp index 433dd64..6accfe4 100644 --- a/platform/local_country_file_utils.hpp +++ b/platform/local_country_file_utils.hpp @@ -3,17 +3,14 @@ #include "platform/country_defines.hpp" #include "platform/local_country_file.hpp" -#include "std/function.hpp" -#include "std/shared_ptr.hpp" -#include "std/unique_ptr.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" +#include +#include +#include class ModelReader; namespace platform { - namespace migrate { bool NeedMigrate(); @@ -24,15 +21,15 @@ void SetMigrationFlag(); // Note. The the maps are deleted from writable dir/|dataDir|/|version| directory. // If |dataDir| is empty (or is not set) the function deletes maps from writable dir. void DeleteDownloaderFilesForCountry(int64_t version, CountryFile const & countryFile); -void DeleteDownloaderFilesForCountry(int64_t version, string const & dataDir, +void DeleteDownloaderFilesForCountry(int64_t version, std::string const & dataDir, CountryFile const & countryFile); // Finds all local map files in |directory|. Version of these files is // passed as an argument. Also, performs cleanup described in comment // for FindAllLocalMapsAndCleanup(). -void FindAllLocalMapsInDirectoryAndCleanup(string const & directory, int64_t version, +void FindAllLocalMapsInDirectoryAndCleanup(std::string const & directory, int64_t version, int64_t latestVersion, - vector & localFiles); + std::vector & localFiles); // Finds all local map files in resources and writable directory. For // Android, checks /Android/obb directory. Subdirectories in the @@ -51,11 +48,11 @@ void FindAllLocalMapsInDirectoryAndCleanup(string const & directory, int64_t ver // CleanupMapsDirectory(). // Note. The the maps are looked for writable dir/|dataDir|/|version| directory. // If |dataDir| is empty (or is not set) the function looks for maps in writable dir. -void FindAllLocalMapsAndCleanup(int64_t latestVersion, vector & localFiles); -void FindAllLocalMapsAndCleanup(int64_t latestVersion, string const & dataDir, - vector & localFiles); +void FindAllLocalMapsAndCleanup(int64_t latestVersion, std::vector & localFiles); +void FindAllLocalMapsAndCleanup(int64_t latestVersion, std::string const & dataDir, + std::vector & localFiles); -void FindAllDiffs(string const & dataDir, vector & diffs); +void FindAllDiffs(std::string const & dataDir, std::vector & diffs); // This method removes: // * partially downloaded non-latest maps (with version less than |latestVersion|) @@ -68,23 +65,23 @@ void CleanupMapsDirectory(int64_t latestVersion); // Tries to parse a version from a string of size not longer than 18 // symbols and representing an unsigned decimal number. Leading zeroes // are allowed. -bool ParseVersion(string const & s, int64_t & version); +bool ParseVersion(std::string const & s, int64_t & version); // When version is zero, uses writable directory, otherwise, creates // directory with name equal to decimal representation of version. // Note. The function assumes the maps are located in writable dir/|dataDir|/|version| directory. // If |dataDir| is empty (or is not set) the function assumes that maps are in writable dir. -shared_ptr PreparePlaceForCountryFiles(int64_t version, CountryFile const & countryFile); -shared_ptr PreparePlaceForCountryFiles(int64_t version, string const & dataDir, +std::shared_ptr PreparePlaceForCountryFiles(int64_t version, CountryFile const & countryFile); +std::shared_ptr PreparePlaceForCountryFiles(int64_t version, std::string const & dataDir, CountryFile const & countryFile); // Note. The function assumes the maps are located in writable dir/|dataDir|/|version| directory. // If |dataDir| is empty (or is not set) the function assumes that maps are in writable dir. -string GetFileDownloadPath(int64_t version, CountryFile const & countryFile, MapOptions file); -string GetFileDownloadPath(int64_t version, string const & dataDir, +std::string GetFileDownloadPath(int64_t version, CountryFile const & countryFile, MapOptions file); +std::string GetFileDownloadPath(int64_t version, std::string const & dataDir, CountryFile const & countryFile, MapOptions file); -unique_ptr GetCountryReader(LocalCountryFile const & file, MapOptions options); +std::unique_ptr GetCountryReader(LocalCountryFile const & file, MapOptions options); // An API for managing country indexes. class CountryIndexes @@ -108,20 +105,20 @@ public: // Returns full path to country index. Note that this method does // not create a file on disk - it just returns a path where the // index should be created/accessed/removed. - static string GetPath(LocalCountryFile const & localFile, Index index); + static std::string GetPath(LocalCountryFile const & localFile, Index index); // Pushes to the exts's end possible index files extensions. - static void GetIndexesExts(vector & exts); + static void GetIndexesExts(std::vector & exts); // Returns true if |file| corresponds to an index file. - static bool IsIndexFile(string const & file); + static bool IsIndexFile(std::string const & file); private: friend void UnitTest_LocalCountryFile_CountryIndexes(); friend void UnitTest_LocalCountryFile_DoNotDeleteUserFiles(); - static string IndexesDir(LocalCountryFile const & localFile); + static std::string IndexesDir(LocalCountryFile const & localFile); }; -string DebugPrint(CountryIndexes::Index index); +std::string DebugPrint(CountryIndexes::Index index); } // namespace platform diff --git a/platform/mwm_version.cpp b/platform/mwm_version.cpp index e887a96..4d92d85 100644 --- a/platform/mwm_version.cpp +++ b/platform/mwm_version.cpp @@ -64,7 +64,7 @@ bool MwmVersion::IsEditableMap() const return m_secondsSinceEpoch + kMaxSecondsTillNoEdits > base::SecondsSinceEpoch(); } -string DebugPrint(Format f) +std::string DebugPrint(Format f) { return "v" + strings::to_string(static_cast(f) + 1); } diff --git a/platform/mwm_version.hpp b/platform/mwm_version.hpp index 0ab81e4..540bed2 100644 --- a/platform/mwm_version.hpp +++ b/platform/mwm_version.hpp @@ -1,7 +1,7 @@ #pragma once -#include "std/cstdint.hpp" -#include "std/string.hpp" +#include +#include class FilesContainerR; class ReaderSrc; @@ -26,7 +26,7 @@ enum class Format lastFormat = v9 }; -string DebugPrint(Format f); +std::string DebugPrint(Format f); class MwmVersion { diff --git a/platform/platform_linux.cpp b/platform/platform_linux.cpp index c7d1909..416ab34 100644 --- a/platform/platform_linux.cpp +++ b/platform/platform_linux.cpp @@ -9,10 +9,10 @@ #include "base/macros.hpp" #include "base/scope_guard.hpp" -#include "std/algorithm.hpp" -#include "std/bind.hpp" -#include "std/initializer_list.hpp" -#include "std/string.hpp" +#include +#include +#include +#include #include #include diff --git a/platform/platform_tests/measurement_tests.cpp b/platform/platform_tests/measurement_tests.cpp index e616222..402d42e 100644 --- a/platform/platform_tests/measurement_tests.cpp +++ b/platform/platform_tests/measurement_tests.cpp @@ -5,7 +5,8 @@ #include "base/math.hpp" -#include "std/utility.hpp" +#include +#include using namespace measurement_utils; using namespace settings; @@ -36,28 +37,28 @@ UNIT_TEST(Measurement_Smoke) { ScopedSettings guard(Units::Metric); - typedef pair PairT; + using Pair = std::pair; - PairT arr[] = { - PairT(10.0, "10 m"), - PairT(10.4, "10 m"), - PairT(10.51, "11 m"), - PairT(1000.0, "1.0 km"), - PairT(1100.0, "1.1 km"), - PairT(1140.0, "1.1 km"), - PairT(1151.0, "1.2 km"), - PairT(1500.0, "1.5 km"), - PairT(1549.9, "1.5 km"), - PairT(1551.0, "1.6 km"), - PairT(10000.0, "10 km"), - PairT(10400.0, "10 km"), - PairT(10499.9, "10 km"), - PairT(10501.0, "11 km") + Pair arr[] = { + Pair(10.0, "10 m"), + Pair(10.4, "10 m"), + Pair(10.51, "11 m"), + Pair(1000.0, "1.0 km"), + Pair(1100.0, "1.1 km"), + Pair(1140.0, "1.1 km"), + Pair(1151.0, "1.2 km"), + Pair(1500.0, "1.5 km"), + Pair(1549.9, "1.5 km"), + Pair(1551.0, "1.6 km"), + Pair(10000.0, "10 km"), + Pair(10400.0, "10 km"), + Pair(10499.9, "10 km"), + Pair(10501.0, "11 km") }; for (size_t i = 0; i < ARRAY_SIZE(arr); ++i) { - string s; + std::string s; TEST(FormatDistance(arr[i].first, s), (arr[i])); TEST_EQUAL(s, arr[i].second, (arr[i])); } diff --git a/platform/platform_tests/mwm_version_test.cpp b/platform/platform_tests/mwm_version_test.cpp index f2b7795..879b3a8 100644 --- a/platform/platform_tests/mwm_version_test.cpp +++ b/platform/platform_tests/mwm_version_test.cpp @@ -6,7 +6,9 @@ #include "platform/mwm_version.hpp" -#include "std/string.hpp" +#include + +using namespace std; namespace { diff --git a/platform/platform_tests/platform_test.cpp b/platform/platform_tests/platform_test.cpp index 8ad2ce4..6879adc 100644 --- a/platform/platform_tests/platform_test.cpp +++ b/platform/platform_tests/platform_test.cpp @@ -4,8 +4,6 @@ #include "platform/platform.hpp" #include "platform/platform_tests_support/scoped_file.hpp" -#include "defines.hpp" - #include "coding/file_writer.hpp" #include "coding/internal/file_data.hpp" @@ -13,23 +11,25 @@ #include "base/logging.hpp" #include "base/scope_guard.hpp" -#include "std/bind.hpp" -#include "std/initializer_list.hpp" -#include "std/set.hpp" +#include +#include +#include +#include +#include -using namespace std; +#include "defines.hpp" namespace { char const * TEST_FILE_NAME = "some_temporary_unit_test_file.tmp"; -void CheckFilesPresence(string const & baseDir, unsigned typeMask, - initializer_list> const & files) +void CheckFilesPresence(std::string const & baseDir, unsigned typeMask, + std::initializer_list> const & files) { Platform::TFilesWithType fwts; Platform::GetFilesByType(baseDir, typeMask, fwts); - multiset filesSet; + std::multiset filesSet; for (auto const & fwt : fwts) filesSet.insert(fwt.first); @@ -40,7 +40,7 @@ void CheckFilesPresence(string const & baseDir, unsigned typeMask, UNIT_TEST(WritableDir) { - string const path = GetPlatform().WritableDir() + TEST_FILE_NAME; + std::string const path = GetPlatform().WritableDir() + TEST_FILE_NAME; try { @@ -58,8 +58,8 @@ UNIT_TEST(WritableDir) UNIT_TEST(WritablePathForFile) { Platform & pl = GetPlatform(); - string const p1 = pl.WritableDir() + TEST_FILE_NAME; - string const p2 = pl.WritablePathForFile(TEST_FILE_NAME); + std::string const p1 = pl.WritableDir() + TEST_FILE_NAME; + std::string const p2 = pl.WritablePathForFile(TEST_FILE_NAME); TEST_EQUAL(p1, p2, ()); } @@ -68,6 +68,7 @@ UNIT_TEST(GetReader) char const * NON_EXISTING_FILE = "mgbwuerhsnmbui45efhdbn34.tmp"; char const * arr[] = { "classificator.txt", + "minsk-pass.mwm" }; Platform & p = GetPlatform(); @@ -94,7 +95,7 @@ UNIT_TEST(GetFilesInDir_Smoke) Platform & pl = GetPlatform(); Platform::FilesList files1, files2; - string const dir = pl.ResourcesDir(); + std::string const dir = pl.ResourcesDir(); pl.GetFilesByExt(dir, DATA_FILE_EXTENSION, files1); TEST_GREATER(files1.size(), 0, (dir, "folder should contain some data files")); @@ -109,9 +110,9 @@ UNIT_TEST(GetFilesInDir_Smoke) UNIT_TEST(DirsRoutines) { - string const baseDir = GetPlatform().WritableDir(); - string const testDir = base::JoinPath(baseDir, "test-dir"); - string const testFile = base::JoinPath(testDir, "test-file"); + std::string const baseDir = GetPlatform().WritableDir(); + std::string const testDir = base::JoinPath(baseDir, "test-dir"); + std::string const testFile = base::JoinPath(testDir, "test-file"); TEST(!Platform::IsFileExistsByFullPath(testDir), ()); TEST_EQUAL(Platform::MkDir(testDir), Platform::ERR_OK, ()); @@ -132,16 +133,16 @@ UNIT_TEST(DirsRoutines) UNIT_TEST(GetFilesByType) { - string const kTestDirBaseName = "test-dir"; - string const kTestFileBaseName = "test-file"; + std::string const kTestDirBaseName = "test-dir"; + std::string const kTestFileBaseName = "test-file"; - string const baseDir = GetPlatform().WritableDir(); + std::string const baseDir = GetPlatform().WritableDir(); - string const testDir = base::JoinPath(baseDir, kTestDirBaseName); + std::string const testDir = base::JoinPath(baseDir, kTestDirBaseName); TEST_EQUAL(Platform::MkDir(testDir), Platform::ERR_OK, ()); SCOPE_GUARD(removeTestDir, bind(&Platform::RmDir, testDir)); - string const testFile = base::JoinPath(baseDir, kTestFileBaseName); + std::string const testFile = base::JoinPath(baseDir, kTestFileBaseName); TEST(!Platform::IsFileExistsByFullPath(testFile), ()); { FileWriter writer(testFile); @@ -179,7 +180,7 @@ UNIT_TEST(GetFileSize) TEST(!pl.GetFileSizeByName("adsmngfuwrbfyfwe", size), ()); TEST(!pl.IsFileExistsByFullPath("adsmngfuwrbfyfwe"), ()); - string const fileName = pl.WritablePathForFile(TEST_FILE_NAME); + std::string const fileName = pl.WritablePathForFile(TEST_FILE_NAME); { FileWriter testFile(fileName); testFile.Write("HOHOHO", 6); @@ -216,15 +217,15 @@ UNIT_TEST(GetWritableStorageStatus) UNIT_TEST(RmDirRecursively) { - string const testDir1 = base::JoinPath(GetPlatform().WritableDir(), "test_dir1"); + std::string const testDir1 = base::JoinPath(GetPlatform().WritableDir(), "test_dir1"); TEST_EQUAL(Platform::MkDir(testDir1), Platform::ERR_OK, ()); SCOPE_GUARD(removeTestDir1, bind(&Platform::RmDir, testDir1)); - string const testDir2 = base::JoinPath(testDir1, "test_dir2"); + std::string const testDir2 = base::JoinPath(testDir1, "test_dir2"); TEST_EQUAL(Platform::MkDir(testDir2), Platform::ERR_OK, ()); SCOPE_GUARD(removeTestDir2, bind(&Platform::RmDir, testDir2)); - string const filePath = base::JoinPath(testDir2, "test_file"); + std::string const filePath = base::JoinPath(testDir2, "test_file"); { FileWriter testFile(filePath); testFile.Write("HOHOHO", 6); diff --git a/platform/platform_tests_support/scoped_dir.cpp b/platform/platform_tests_support/scoped_dir.cpp index 3af7cc5..6aa976d 100644 --- a/platform/platform_tests_support/scoped_dir.cpp +++ b/platform/platform_tests_support/scoped_dir.cpp @@ -5,13 +5,13 @@ #include "base/file_name_utils.hpp" #include "base/logging.hpp" -#include "std/sstream.hpp" +#include namespace platform { namespace tests_support { -ScopedDir::ScopedDir(string const & relativePath) +ScopedDir::ScopedDir(std::string const & relativePath) : m_fullPath(base::JoinPath(GetPlatform().WritableDir(), relativePath)) , m_relativePath(relativePath) , m_reset(false) @@ -32,7 +32,7 @@ ScopedDir::ScopedDir(string const & relativePath) } } -ScopedDir::ScopedDir(ScopedDir const & parent, string const & name) +ScopedDir::ScopedDir(ScopedDir const & parent, std::string const & name) : ScopedDir(base::JoinPath(parent.GetRelativePath(), name)) { } @@ -42,7 +42,7 @@ ScopedDir::~ScopedDir() if (m_reset) return; - string const fullPath = GetFullPath(); + std::string const fullPath = GetFullPath(); Platform::EError ret = Platform::RmDir(fullPath); switch (ret) { @@ -60,9 +60,9 @@ ScopedDir::~ScopedDir() } } -string DebugPrint(ScopedDir const & dir) +std::string DebugPrint(ScopedDir const & dir) { - ostringstream os; + std::ostringstream os; os << "ScopedDir [" << dir.GetFullPath() << "]"; return os.str(); } diff --git a/platform/platform_tests_support/scoped_dir.hpp b/platform/platform_tests_support/scoped_dir.hpp index 4095a47..743bdfc 100644 --- a/platform/platform_tests_support/scoped_dir.hpp +++ b/platform/platform_tests_support/scoped_dir.hpp @@ -4,7 +4,7 @@ #include "base/macros.hpp" -#include "std/string.hpp" +#include namespace platform { @@ -16,28 +16,28 @@ class ScopedDir public: /// Creates test dir in a writable directory. /// @param path Path for a testing directory, should be relative to writable-dir. - ScopedDir(string const & relativePath); + ScopedDir(std::string const & relativePath); - ScopedDir(ScopedDir const & parent, string const & name); + ScopedDir(ScopedDir const & parent, std::string const & name); ~ScopedDir(); - inline void Reset() { m_reset = true; } + void Reset() { m_reset = true; } - inline string const & GetFullPath() const { return m_fullPath; } + std::string const & GetFullPath() const { return m_fullPath; } - inline string const & GetRelativePath() const { return m_relativePath; } + std::string const & GetRelativePath() const { return m_relativePath; } bool Exists() const { return GetPlatform().IsFileExistsByFullPath(GetFullPath()); } private: - string const m_fullPath; - string const m_relativePath; + std::string const m_fullPath; + std::string const m_relativePath; bool m_reset; DISALLOW_COPY_AND_MOVE(ScopedDir); }; -string DebugPrint(ScopedDir const & dir); +std::string DebugPrint(ScopedDir const & dir); } // namespace tests_support } // namespace platform diff --git a/platform/platform_tests_support/scoped_file.cpp b/platform/platform_tests_support/scoped_file.cpp index 4a9c5c9..882fd20 100644 --- a/platform/platform_tests_support/scoped_file.cpp +++ b/platform/platform_tests_support/scoped_file.cpp @@ -14,18 +14,18 @@ #include "base/file_name_utils.hpp" #include "base/logging.hpp" -#include "std/sstream.hpp" +#include namespace platform { namespace tests_support { -ScopedFile::ScopedFile(string const & relativePath, Mode mode) +ScopedFile::ScopedFile(std::string const & relativePath, Mode mode) : ScopedFile(relativePath, {} /* contents */, mode) { } -ScopedFile::ScopedFile(string const & relativePath, string const & contents) +ScopedFile::ScopedFile(std::string const & relativePath, std::string const & contents) : ScopedFile(relativePath, contents, Mode::Create) { } @@ -39,7 +39,7 @@ ScopedFile::ScopedFile(ScopedDir const & dir, CountryFile const & countryFile, { } -ScopedFile::ScopedFile(string const & relativePath, string const & contents, Mode mode) +ScopedFile::ScopedFile(std::string const & relativePath, std::string const & contents, Mode mode) : m_fullPath(base::JoinPath(GetPlatform().WritableDir(), relativePath)) { if (mode == Mode::DoNotCreate) @@ -71,9 +71,9 @@ ScopedFile::~ScopedFile() LOG(LERROR, ("Can't remove test file:", GetFullPath())); } -string DebugPrint(ScopedFile const & file) +std::string DebugPrint(ScopedFile const & file) { - ostringstream os; + std::ostringstream os; os << "ScopedFile [" << file.GetFullPath() << "]"; return os.str(); } diff --git a/platform/platform_tests_support/scoped_file.hpp b/platform/platform_tests_support/scoped_file.hpp index a7acf57..28b12b8 100644 --- a/platform/platform_tests_support/scoped_file.hpp +++ b/platform/platform_tests_support/scoped_file.hpp @@ -5,7 +5,7 @@ #include "base/macros.hpp" -#include "std/string.hpp" +#include namespace platform { @@ -29,10 +29,10 @@ public: }; // Creates a scoped file in the specified mode. - ScopedFile(string const & relativePath, Mode mode); + ScopedFile(std::string const & relativePath, Mode mode); // Creates a scoped file in Mode::Create and writes |contents| to it. - ScopedFile(string const & relativePath, string const & contents); + ScopedFile(std::string const & relativePath, std::string const & contents); // Creates a scoped file in Mode::Create using the path inferred from |countryFile| // and |mapOptions|. @@ -40,21 +40,21 @@ public: ~ScopedFile(); - inline string const & GetFullPath() const { return m_fullPath; } + std::string const & GetFullPath() const { return m_fullPath; } - inline void Reset() { m_reset = true; } + void Reset() { m_reset = true; } - inline bool Exists() const { return GetPlatform().IsFileExistsByFullPath(GetFullPath()); } + bool Exists() const { return GetPlatform().IsFileExistsByFullPath(GetFullPath()); } private: - ScopedFile(string const & relativePath, string const & contents, Mode mode); + ScopedFile(std::string const & relativePath, std::string const & contents, Mode mode); - string const m_fullPath; + std::string const m_fullPath; bool m_reset = false; DISALLOW_COPY_AND_MOVE(ScopedFile); }; -string DebugPrint(ScopedFile const & file); +std::string DebugPrint(ScopedFile const & file); } // namespace tests_support } // namespace platform diff --git a/platform/platform_tests_support/scoped_mwm.cpp b/platform/platform_tests_support/scoped_mwm.cpp index cf854a1..e9ae415 100644 --- a/platform/platform_tests_support/scoped_mwm.cpp +++ b/platform/platform_tests_support/scoped_mwm.cpp @@ -12,12 +12,14 @@ #include "base/timer.hpp" +#include + using feature::DataHeader; namespace platform { namespace tests_support { -ScopedMwm::ScopedMwm(string const & relativePath) : m_file(relativePath, ScopedFile::Mode::Create) +ScopedMwm::ScopedMwm(std::string const & relativePath) : m_file(relativePath, ScopedFile::Mode::Create) { DataHeader header; { diff --git a/platform/platform_tests_support/scoped_mwm.hpp b/platform/platform_tests_support/scoped_mwm.hpp index e565555..17ef419 100644 --- a/platform/platform_tests_support/scoped_mwm.hpp +++ b/platform/platform_tests_support/scoped_mwm.hpp @@ -1,10 +1,10 @@ #pragma once -#include "scoped_file.hpp" +#include "platform/platform_tests_support/scoped_file.hpp" #include "base/macros.hpp" -#include "std/string.hpp" +#include namespace platform { @@ -15,9 +15,9 @@ class ScopedFile; class ScopedMwm { public: - explicit ScopedMwm(string const & relativePath); + explicit ScopedMwm(std::string const & relativePath); - string const & GetFullPath() const { return m_file.GetFullPath(); } + std::string const & GetFullPath() const { return m_file.GetFullPath(); } private: ScopedFile m_file; diff --git a/platform/platform_tests_support/test_socket.cpp b/platform/platform_tests_support/test_socket.cpp index 22b9a62..f8abf0e 100644 --- a/platform/platform_tests_support/test_socket.cpp +++ b/platform/platform_tests_support/test_socket.cpp @@ -2,8 +2,11 @@ #include "base/assert.hpp" -#include "std/algorithm.hpp" -#include "std/chrono.hpp" +#include +#include + +using namespace std; +using namespace std::chrono; namespace platform { diff --git a/platform/platform_tests_support/test_socket.hpp b/platform/platform_tests_support/test_socket.hpp index 45034d8..30bcdf9 100644 --- a/platform/platform_tests_support/test_socket.hpp +++ b/platform/platform_tests_support/test_socket.hpp @@ -2,13 +2,14 @@ #include "platform/socket.hpp" -#include "std/atomic.hpp" -#include "std/condition_variable.hpp" -#include "std/cstdint.hpp" -#include "std/iterator.hpp" -#include "std/deque.hpp" -#include "std/mutex.hpp" -#include "std/vector.hpp" +#include +#include +#include +#include +#include +#include +#include +#include namespace platform { @@ -19,7 +20,7 @@ class TestSocket final : public Socket public: // Socket overrides: ~TestSocket(); - bool Open(string const & host, uint16_t port) override; + bool Open(std::string const & host, uint16_t port) override; void Close() override; bool Read(uint8_t * data, uint32_t count) override; bool Write(uint8_t const * data, uint32_t count) override; @@ -28,26 +29,26 @@ public: // Simulates server reading. // Waits for some data or timeout. // Returns size of read data. - size_t ReadServer(vector & destination); + size_t ReadServer(std::vector & destination); template void WriteServer(Container const & answer) { - lock_guard lg(m_inputMutex); - m_input.insert(m_input.begin(), begin(answer), end(answer)); + std::lock_guard lg(m_inputMutex); + m_input.insert(m_input.begin(), std::begin(answer), std::end(answer)); m_inputCondition.notify_one(); } private: - atomic m_isConnected = {false}; - atomic m_timeoutMs = {100}; + std::atomic m_isConnected = {false}; + std::atomic m_timeoutMs = {100}; - deque m_input; - mutex m_inputMutex; - condition_variable m_inputCondition; + std::deque m_input; + std::mutex m_inputMutex; + std::condition_variable m_inputCondition; - vector m_output; - mutex m_outputMutex; - condition_variable m_outputCondition; + std::vector m_output; + std::mutex m_outputMutex; + std::condition_variable m_outputCondition; }; } // namespace tests_support } // namespace platform diff --git a/platform/platform_tests_support/writable_dir_changer.hpp b/platform/platform_tests_support/writable_dir_changer.hpp index d00b3d4..654f882 100644 --- a/platform/platform_tests_support/writable_dir_changer.hpp +++ b/platform/platform_tests_support/writable_dir_changer.hpp @@ -1,4 +1,6 @@ -#include "std/string.hpp" +#pragma once + +#include class WritableDirChanger { @@ -8,12 +10,12 @@ public: UseDefault, UseWritableDir }; - WritableDirChanger(string const & testDir, + WritableDirChanger(std::string const & testDir, SettingsDirPolicy settingsDirPolicy = SettingsDirPolicy::UseDefault); ~WritableDirChanger(); private: - string const m_writableDirBeforeTest; - string const m_testDirFullPath; + std::string const m_writableDirBeforeTest; + std::string const m_testDirFullPath; SettingsDirPolicy m_settingsDirPolicy; }; diff --git a/platform/platform_unix_impl.cpp b/platform/platform_unix_impl.cpp index 5a6e40a..3097341 100644 --- a/platform/platform_unix_impl.cpp +++ b/platform/platform_unix_impl.cpp @@ -5,10 +5,6 @@ #include "base/logging.hpp" #include "base/scope_guard.hpp" -#include "std/algorithm.hpp" -#include "std/regex.hpp" -#include "std/unique_ptr.hpp" - #include #include #include @@ -16,6 +12,13 @@ #include #include +#include +#include +#include +#include + +using namespace std; + #if defined(GEOCORE_OS_MAC) #include #else diff --git a/platform/platform_unix_impl.hpp b/platform/platform_unix_impl.hpp index 94177e1..ba86d29 100644 --- a/platform/platform_unix_impl.hpp +++ b/platform/platform_unix_impl.hpp @@ -1,10 +1,10 @@ #pragma once -#include "std/string.hpp" -#include "std/vector.hpp" +#include +#include namespace pl { - void EnumerateFilesByRegExp(string const & directory, string const & regexp, - vector & res); -} +void EnumerateFilesByRegExp(std::string const & directory, std::string const & regexp, + std::vector & res); +} // namespace pl diff --git a/platform/preferred_languages.cpp b/platform/preferred_languages.cpp index d16e81a..7a28024 100644 --- a/platform/preferred_languages.cpp +++ b/platform/preferred_languages.cpp @@ -5,8 +5,6 @@ #include "base/macros.hpp" #include "platform/target_os.hpp" -#include "std/set.hpp" -#include "std/vector.hpp" #if defined(GEOCORE_OS_MAC) #include @@ -15,6 +13,12 @@ #include #endif +#include +#include +#include + +using namespace std; + namespace languages { diff --git a/platform/preferred_languages.hpp b/platform/preferred_languages.hpp index 6f5e8ce..4d3dc22 100644 --- a/platform/preferred_languages.hpp +++ b/platform/preferred_languages.hpp @@ -1,31 +1,24 @@ #pragma once -#include "std/string.hpp" +#include namespace languages { - /// @note These functions are heavy enough to call them often. Be careful. -//@{ /// @return List of original system languages in the form "en-US|ru-RU|es|zh-Hant". -string GetPreferred(); +std::string GetPreferred(); /// @return Original language code for the current user in the form "en-US", "zh-Hant". -string GetCurrentOrig(); +std::string GetCurrentOrig(); /// @return Current language in out Twine translations compatible format, e.g. "en", "pt" or "zh-Hant". -string GetCurrentTwine(); +std::string GetCurrentTwine(); /// @return Normalized language code for the current user in the form "en", "zh". -//@{ /// Returned languages are normalized to our supported languages in the core, see /// string_utf8_multilang.cpp and should not be used with any sub-locales like zh-Hans/zh-Hant. Some /// langs like Danish (da) are not supported in the core too, but used as a locale. -string Normalize(string const & lang); -string GetCurrentNorm(); -//@} - -//@} - -} +std::string Normalize(std::string const & lang); +std::string GetCurrentNorm(); +} // namespace languages diff --git a/platform/settings.cpp b/platform/settings.cpp index 5807f50..5ed652a 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -14,10 +14,9 @@ #include "base/logging.hpp" -#include "std/cmath.hpp" -#include "std/iostream.hpp" -#include "std/sstream.hpp" - +#include +#include +#include using namespace std; diff --git a/platform/settings.hpp b/platform/settings.hpp index 213a535..42ca00d 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -4,7 +4,7 @@ #include "base/macros.hpp" -#include "std/string.hpp" +#include namespace settings { @@ -14,9 +14,10 @@ extern char const * kLocationStateMode; extern char const * kMeasurementUnits; template -bool FromString(string const & str, T & outValue); +bool FromString(std::string const & str, T & outValue); + template -string ToString(T const & value); +std::string ToString(T const & value); class StringStorage : public platform::StringStorageBase { @@ -30,14 +31,14 @@ private: /// Retrieve setting /// @return false if setting is absent template -WARN_UNUSED_RESULT bool Get(string const & key, Value & outValue) +WARN_UNUSED_RESULT bool Get(std::string const & key, Value & outValue) { - string strVal; + std::string strVal; return StringStorage::Instance().GetValue(key, strVal) && FromString(strVal, outValue); } template -void TryGet(string const & key, Value & outValue) +void TryGet(std::string const & key, Value & outValue) { bool unused = Get(key, outValue); UNUSED_VALUE(unused); @@ -45,12 +46,12 @@ void TryGet(string const & key, Value & outValue) /// Automatically saves setting to external file template -void Set(string const & key, Value const & value) +void Set(std::string const & key, Value const & value) { StringStorage::Instance().SetValue(key, ToString(value)); } -inline void Delete(string const & key) { StringStorage::Instance().DeleteKeyAndValue(key); } +inline void Delete(std::string const & key) { StringStorage::Instance().DeleteKeyAndValue(key); } inline void Clear() { StringStorage::Instance().Clear(); } /// Use this function for running some stuff once according to date. @@ -64,15 +65,15 @@ class Settings : public platform::StringStorageBase { public: template - static void Set(string const & key, Value const & value) + static void Set(std::string const & key, Value const & value) { Instance().SetValue(key, settings::ToString(value)); } template - WARN_UNUSED_RESULT static bool Get(string const & key, Value & outValue) + WARN_UNUSED_RESULT static bool Get(std::string const & key, Value & outValue) { - string strVal; + std::string strVal; return Instance().GetValue(key, strVal) && settings::FromString(strVal, outValue); } diff --git a/platform/socket.hpp b/platform/socket.hpp index 7d6bc55..e464ea5 100644 --- a/platform/socket.hpp +++ b/platform/socket.hpp @@ -1,8 +1,8 @@ #pragma once -#include "std/cstdint.hpp" -#include "std/string.hpp" -#include "std/unique_ptr.hpp" +#include +#include +#include namespace platform { @@ -16,7 +16,7 @@ public: // 2. There are should be Close call after each Open call. // 3. Open+Open: second Open does nothing and returns false. // 4. Close+Close: second Close does nothing. - virtual bool Open(string const & host, uint16_t port) = 0; + virtual bool Open(std::string const & host, uint16_t port) = 0; virtual void Close() = 0; // Read is blocking, it waits for the 'count' data size. @@ -30,12 +30,12 @@ class StubSocket final : public Socket { public: // Socket overrides: - bool Open(string const &, uint16_t) override { return false; } + bool Open(std::string const &, uint16_t) override { return false; } void Close() override {} bool Read(uint8_t *, uint32_t) override { return false; } bool Write(uint8_t const *, uint32_t) override { return false; } void SetTimeout(uint32_t) override {} }; -unique_ptr CreateSocket(); +std::unique_ptr CreateSocket(); } // namespace platform diff --git a/platform/socket_apple.mm b/platform/socket_apple.mm index c57ed9c..be072e3 100644 --- a/platform/socket_apple.mm +++ b/platform/socket_apple.mm @@ -160,7 +160,7 @@ public: PlatformSocket(); // Socket overrides ~PlatformSocket(); - bool Open(string const & host, uint16_t port) override; + bool Open(std::string const & host, uint16_t port) override; void Close() override; bool Read(uint8_t * data, uint32_t count) override; bool Write(uint8_t const * data, uint32_t count) override; @@ -170,9 +170,9 @@ private: SocketImpl * m_socketImpl = nullptr; }; -unique_ptr CreateSocket() +std::unique_ptr CreateSocket() { - return make_unique(); + return std::make_unique(); } PlatformSocket::PlatformSocket() { m_socketImpl = [[SocketImpl alloc] init]; } @@ -183,7 +183,7 @@ PlatformSocket::~PlatformSocket() m_socketImpl = nullptr; } -bool PlatformSocket::Open(string const & host, uint16_t port) +bool PlatformSocket::Open(std::string const & host, uint16_t port) { return [m_socketImpl open:@(host.c_str()) port:port]; } diff --git a/std/algorithm.hpp b/std/algorithm.hpp deleted file mode 100644 index 7fa9fa2..0000000 --- a/std/algorithm.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include - -using std::all_of; -using std::any_of; -using std::binary_search; -using std::copy; -using std::equal; -using std::equal_range; -using std::fill; -using std::find; -using std::find_first_of; -using std::find_if; -using std::for_each; -using std::is_sorted; -using std::iter_swap; -using std::lexicographical_compare; -using std::lower_bound; -using std::max; -using std::max_element; -using std::min; -using std::min_element; -using std::minmax_element; -using std::next_permutation; -using std::none_of; -using std::nth_element; -using std::partial_sort; -using std::remove_if; -using std::replace; -using std::reverse; -using std::set_intersection; -using std::set_union; -using std::sort; -using std::stable_partition; -using std::stable_sort; -using std::swap; -using std::unique; -using std::upper_bound; -using std::set_difference; -using std::distance; -using std::generate; -using std::pop_heap; -using std::push_heap; -using std::remove_copy_if; -using std::set_symmetric_difference; -using std::sort_heap; -using std::transform; diff --git a/std/atomic.hpp b/std/atomic.hpp deleted file mode 100644 index c9f81c8..0000000 --- a/std/atomic.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include - -using std::atomic; -using std::atomic_flag; diff --git a/std/bind.hpp b/std/bind.hpp deleted file mode 100644 index d6c8be2..0000000 --- a/std/bind.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - - -#include -using std::bind; -using std::ref; -using std::cref; -using std::placeholders::_1; -using std::placeholders::_2; -using std::placeholders::_3; -using std::placeholders::_4; -using std::placeholders::_5; -using std::placeholders::_6; -using std::placeholders::_7; -using std::placeholders::_8; diff --git a/std/cctype.hpp b/std/cctype.hpp deleted file mode 100644 index 7cd7eee..0000000 --- a/std/cctype.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -using std::isdigit; diff --git a/std/chrono.hpp b/std/chrono.hpp deleted file mode 100644 index 5dc2673..0000000 --- a/std/chrono.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -using std::chrono::duration; -using std::chrono::duration_cast; -using std::chrono::high_resolution_clock; -using std::chrono::hours; -using std::chrono::milliseconds; -using std::chrono::minutes; -using std::chrono::nanoseconds; -using std::chrono::seconds; -using std::chrono::steady_clock; -using std::chrono::system_clock; -using std::chrono::time_point; -using std::chrono::time_point_cast; - diff --git a/std/cmath.hpp b/std/cmath.hpp deleted file mode 100644 index 85ffaa7..0000000 --- a/std/cmath.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -// We do not define _USE_MATH_DEFINES - please add your constants below. -#include - -using std::abs; -using std::cos; -using std::isfinite; -using std::sin; -using std::log10; diff --git a/std/condition_variable.hpp b/std/condition_variable.hpp deleted file mode 100644 index a566bbb..0000000 --- a/std/condition_variable.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include - -using std::condition_variable; -using std::cv_status; diff --git a/std/cstdint.hpp b/std/cstdint.hpp deleted file mode 100644 index 707a689..0000000 --- a/std/cstdint.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include - -using std::int8_t; -using std::uint8_t; -using std::int16_t; -using std::uint16_t; -using std::int32_t; -using std::uint32_t; -using std::int64_t; -using std::uint64_t; diff --git a/std/deque.hpp b/std/deque.hpp deleted file mode 100644 index 35180cd..0000000 --- a/std/deque.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -using std::deque; diff --git a/std/function.hpp b/std/function.hpp deleted file mode 100644 index e343f36..0000000 --- a/std/function.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::function; -using std::greater; diff --git a/std/initializer_list.hpp b/std/initializer_list.hpp deleted file mode 100644 index ed2f863..0000000 --- a/std/initializer_list.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::initializer_list; -using StringIL = initializer_list; diff --git a/std/iostream.hpp b/std/iostream.hpp deleted file mode 100644 index 8ca5b9b..0000000 --- a/std/iostream.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -using std::cin; -using std::cout; -using std::cerr; - -using std::istream; -using std::ostream; - -using std::ios_base; - -using std::endl; -using std::flush; - diff --git a/std/iterator.hpp b/std/iterator.hpp deleted file mode 100644 index e724615..0000000 --- a/std/iterator.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include - -using std::advance; -using std::back_insert_iterator; -using std::back_inserter; -using std::begin; -using std::distance; -using std::end; -using std::insert_iterator; -using std::inserter; -using std::istream_iterator; -using std::istreambuf_iterator; -using std::iterator_traits; -using std::next; -using std::reverse_iterator; - diff --git a/std/iterator_facade.hpp b/std/iterator_facade.hpp deleted file mode 100644 index d1a19dc..0000000 --- a/std/iterator_facade.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -using boost::iterator_facade; -using boost::random_access_traversal_tag; -using boost::forward_traversal_tag; diff --git a/std/list.hpp b/std/list.hpp deleted file mode 100644 index c351686..0000000 --- a/std/list.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -using std::list; diff --git a/std/mutex.hpp b/std/mutex.hpp deleted file mode 100644 index 45fe706..0000000 --- a/std/mutex.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -using std::lock_guard; -using std::mutex; -using std::timed_mutex; -using std::unique_lock; diff --git a/std/regex.hpp b/std/regex.hpp deleted file mode 100644 index 796c9d5..0000000 --- a/std/regex.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include - -using std::regex; -using std::regex_match; -using std::regex_search; -using std::sregex_token_iterator; -using std::regex_replace; diff --git a/std/set.hpp b/std/set.hpp deleted file mode 100644 index 8b571fa..0000000 --- a/std/set.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::multiset; -using std::set; diff --git a/std/shared_array.hpp b/std/shared_array.hpp deleted file mode 100644 index 1feca2e..0000000 --- a/std/shared_array.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -using boost::shared_array; diff --git a/std/shared_ptr.hpp b/std/shared_ptr.hpp deleted file mode 100644 index 46f1e8a..0000000 --- a/std/shared_ptr.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -using std::shared_ptr; -using std::make_shared; -using std::enable_shared_from_this; diff --git a/std/sstream.hpp b/std/sstream.hpp deleted file mode 100644 index ab43f4d..0000000 --- a/std/sstream.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -using std::istringstream; -using std::ostringstream; -using std::stringstream; -using std::endl; diff --git a/std/string.hpp b/std/string.hpp deleted file mode 100644 index 60ca95c..0000000 --- a/std/string.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include - -using std::basic_string; -using std::getline; -using std::stoi; -using std::stod; -using std::string; -using std::to_string; diff --git a/std/transform_iterator.hpp b/std/transform_iterator.hpp deleted file mode 100644 index cc6cbea..0000000 --- a/std/transform_iterator.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -using boost::make_transform_iterator; diff --git a/std/unique_ptr.hpp b/std/unique_ptr.hpp deleted file mode 100644 index 4f554f8..0000000 --- a/std/unique_ptr.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::unique_ptr; -using std::make_unique; diff --git a/std/unordered_map.hpp b/std/unordered_map.hpp deleted file mode 100644 index f9c2a09..0000000 --- a/std/unordered_map.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::unordered_map; -using std::unordered_multimap; diff --git a/std/unordered_set.hpp b/std/unordered_set.hpp deleted file mode 100644 index ae678c8..0000000 --- a/std/unordered_set.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -using std::unordered_set; -using std::unordered_multiset; diff --git a/std/utility.hpp b/std/utility.hpp deleted file mode 100644 index 367ecce..0000000 --- a/std/utility.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -using std::forward; -using std::make_pair; -using std::move; -using std::pair; diff --git a/std/vector.hpp b/std/vector.hpp deleted file mode 100644 index f470cfa..0000000 --- a/std/vector.hpp +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#include -using std::vector;