This commit is contained in:
LaGrunge 2019-09-24 09:26:40 +00:00
parent c586236145
commit e877c61940
74 changed files with 279 additions and 505 deletions

View file

@ -1,6 +1,6 @@
#pragma once
#include "std/algorithm.hpp"
#include <algorithm>
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

View file

@ -1,13 +1,14 @@
#pragma once
#include "coding/reader.hpp"
#include "base/assert.hpp"
#include "base/exception.hpp"
#include "std/iterator_facade.hpp"
#include <type_traits>
#include <boost/iterator/iterator_facade.hpp>
// Disk-driven vector.
template <typename T, class TReader, typename TSize = uint32_t>
class DDVector
@ -43,10 +44,10 @@ public:
return ReadPrimitiveFromPos<T>(m_reader, static_cast<uint64_t>(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

View file

@ -5,8 +5,6 @@
#include "base/assert.hpp"
#include "base/exception.hpp"
#include "std/shared_array.hpp"
#include <cstddef>
#include <cstdint>
#include <cstring>

View file

@ -8,6 +8,7 @@
#include "base/logging.hpp"
#include <vector>
using namespace feature;
@ -20,7 +21,7 @@ namespace check_model
FeaturesVectorTest(fName).GetVector().ForEach([&](FeatureType & ft, uint32_t) {
TypesHolder types(ft);
vector<uint32_t> vTypes;
std::vector<uint32_t> vTypes;
for (uint32_t t : types)
{
CHECK_EQUAL(c.GetTypeForIndex(c.GetIndexForType(t)), t, ());

View file

@ -7,6 +7,7 @@
#include "geometry/tree4d.hpp"
#include "geometry/region2d.hpp"
#include <vector>
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<feature::FeatureBuilder> & vecFb);
void GetFeatures(std::vector<feature::FeatureBuilder> & vecFb);
};

View file

@ -58,7 +58,7 @@ feature::FeatureBuilder FeatureBuilderFromOmsElementData(OsmElementData const &
{
auto const & p1 = elementData.m_polygon[0];
auto const & p2 = elementData.m_polygon[1];
vector<m2::PointD> poly = {
std::vector<m2::PointD> 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({});

View file

@ -10,6 +10,11 @@
#include "defines.hpp"
#include <string>
#include <vector>
using namespace std;
namespace generator
{
RawGenerator::RawGenerator(feature::GenerateInfo & genInfo, size_t threadsCount, size_t chunkSize)

View file

@ -9,8 +9,6 @@
#include "base/string_utils.hpp"
#include "base/thread_pool_computational.hpp"
#include "std/unordered_map.hpp"
#include <algorithm>
#include <chrono>
#include <fstream>

View file

@ -9,7 +9,9 @@
#include <limits>
#include <sstream>
#include "std/transform_iterator.hpp"
#include <boost/iterator/transform_iterator.hpp>
using boost::make_transform_iterator;
using namespace std;
using namespace strings;

View file

@ -13,6 +13,7 @@
#include "base/base.hpp"
#include "base/control_flow.hpp"
#include <string>
#include <unordered_map>
#include <utility>

View file

@ -4,6 +4,7 @@
#include "base/base.hpp"
#include <vector>
#include <vector>
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:

View file

@ -5,6 +5,8 @@
#include "platform/constants.hpp"
#include "platform/mwm_version.hpp"
#include <string>
std::unique_ptr<FeatureType> 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)))
{
}

View file

@ -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();

View file

@ -5,14 +5,15 @@
#include "base/logging.hpp"
#include <string>
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);

View file

@ -3,11 +3,13 @@
#include "indexer/data_header.hpp"
#include "indexer/scale_index_builder.hpp"
#include <string>
namespace indexer
{
template <class TFeaturesVector, typename TWriter>
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);
}

View file

@ -6,6 +6,7 @@
#include <algorithm>
#include <array>
#include <string>
#include <unordered_map>
#include <utility>
@ -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)

View file

@ -1,6 +1,6 @@
#pragma once
#include "std/cstdint.hpp"
#include <cstdint>
static const uint32_t READER_CHUNK_LOG_SIZE = 10;
static const uint32_t READER_CHUNK_LOG_COUNT = 12;

View file

@ -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 <sstream>
#include "defines.hpp"
using namespace std;
namespace
{
@ -27,7 +30,7 @@ string GetNameWithExt(string const & countryFile, MapOptions file)
return string();
}
}
} // namespace
} // namespace
namespace platform
{

View file

@ -1,7 +1,9 @@
#pragma once
#include "platform/country_defines.hpp"
#include "std/string.hpp"
#include <cstdint>
#include <string>
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

View file

@ -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 <sstream>
using namespace std;
namespace platform
{

View file

@ -3,8 +3,9 @@
#include "platform/country_file.hpp"
#include "platform/country_defines.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"
#include <cstdint>
#include <string>
#include <vector>
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<unsigned>(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<LocalCountryFile> & localFiles);
std::string const & dataDir, std::vector<LocalCountryFile> & 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

View file

@ -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 <algorithm>
#include <cctype>
#include <memory>
#include <regex>
#include <sstream>
#include <unordered_set>
#include "defines.hpp"
using namespace std;
namespace platform
{
namespace migrate

View file

@ -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 <cstdint>
#include <memory>
#include <vector>
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<LocalCountryFile> & localFiles);
std::vector<LocalCountryFile> & 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<LocalCountryFile> & localFiles);
void FindAllLocalMapsAndCleanup(int64_t latestVersion, string const & dataDir,
vector<LocalCountryFile> & localFiles);
void FindAllLocalMapsAndCleanup(int64_t latestVersion, std::vector<LocalCountryFile> & localFiles);
void FindAllLocalMapsAndCleanup(int64_t latestVersion, std::string const & dataDir,
std::vector<LocalCountryFile> & localFiles);
void FindAllDiffs(string const & dataDir, vector<LocalCountryFile> & diffs);
void FindAllDiffs(std::string const & dataDir, std::vector<LocalCountryFile> & 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<LocalCountryFile> PreparePlaceForCountryFiles(int64_t version, CountryFile const & countryFile);
shared_ptr<LocalCountryFile> PreparePlaceForCountryFiles(int64_t version, string const & dataDir,
std::shared_ptr<LocalCountryFile> PreparePlaceForCountryFiles(int64_t version, CountryFile const & countryFile);
std::shared_ptr<LocalCountryFile> 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<ModelReader> GetCountryReader(LocalCountryFile const & file, MapOptions options);
std::unique_ptr<ModelReader> 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<string> & exts);
static void GetIndexesExts(std::vector<std::string> & 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

View file

@ -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<uint32_t>(f) + 1);
}

View file

@ -1,7 +1,7 @@
#pragma once
#include "std/cstdint.hpp"
#include "std/string.hpp"
#include <cstdint>
#include <string>
class FilesContainerR;
class ReaderSrc;
@ -26,7 +26,7 @@ enum class Format
lastFormat = v9
};
string DebugPrint(Format f);
std::string DebugPrint(Format f);
class MwmVersion
{

View file

@ -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 <algorithm>
#include <functional>
#include <initializer_list>
#include <string>
#include <stdlib.h>
#include <unistd.h>

View file

@ -5,7 +5,8 @@
#include "base/math.hpp"
#include "std/utility.hpp"
#include <string>
#include <utility>
using namespace measurement_utils;
using namespace settings;
@ -36,28 +37,28 @@ UNIT_TEST(Measurement_Smoke)
{
ScopedSettings guard(Units::Metric);
typedef pair<double, char const *> PairT;
using Pair = std::pair<double, char const *>;
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]));
}

View file

@ -6,7 +6,9 @@
#include "platform/mwm_version.hpp"
#include "std/string.hpp"
#include <string>
using namespace std;
namespace
{

View file

@ -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 <functional>
#include <initializer_list>
#include <set>
#include <string>
#include <utility>
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<pair<string, size_t>> const & files)
void CheckFilesPresence(std::string const & baseDir, unsigned typeMask,
std::initializer_list<std::pair<std::string, size_t>> const & files)
{
Platform::TFilesWithType fwts;
Platform::GetFilesByType(baseDir, typeMask, fwts);
multiset<string> filesSet;
std::multiset<std::string> 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);

View file

@ -5,13 +5,13 @@
#include "base/file_name_utils.hpp"
#include "base/logging.hpp"
#include "std/sstream.hpp"
#include <sstream>
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();
}

View file

@ -4,7 +4,7 @@
#include "base/macros.hpp"
#include "std/string.hpp"
#include <string>
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

View file

@ -14,18 +14,18 @@
#include "base/file_name_utils.hpp"
#include "base/logging.hpp"
#include "std/sstream.hpp"
#include <sstream>
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();
}

View file

@ -5,7 +5,7 @@
#include "base/macros.hpp"
#include "std/string.hpp"
#include <string>
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

View file

@ -12,12 +12,14 @@
#include "base/timer.hpp"
#include <string>
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;
{

View file

@ -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 <string>
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;

View file

@ -2,8 +2,11 @@
#include "base/assert.hpp"
#include "std/algorithm.hpp"
#include "std/chrono.hpp"
#include <algorithm>
#include <chrono>
using namespace std;
using namespace std::chrono;
namespace platform
{

View file

@ -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 <atomic>
#include <condition_variable>
#include <cstdint>
#include <deque>
#include <iterator>
#include <mutex>
#include <string>
#include <vector>
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<uint8_t> & destination);
size_t ReadServer(std::vector<uint8_t> & destination);
template <typename Container>
void WriteServer(Container const & answer)
{
lock_guard<mutex> lg(m_inputMutex);
m_input.insert(m_input.begin(), begin(answer), end(answer));
std::lock_guard<std::mutex> lg(m_inputMutex);
m_input.insert(m_input.begin(), std::begin(answer), std::end(answer));
m_inputCondition.notify_one();
}
private:
atomic<bool> m_isConnected = {false};
atomic<uint32_t> m_timeoutMs = {100};
std::atomic<bool> m_isConnected = {false};
std::atomic<uint32_t> m_timeoutMs = {100};
deque<uint8_t> m_input;
mutex m_inputMutex;
condition_variable m_inputCondition;
std::deque<uint8_t> m_input;
std::mutex m_inputMutex;
std::condition_variable m_inputCondition;
vector<uint8_t> m_output;
mutex m_outputMutex;
condition_variable m_outputCondition;
std::vector<uint8_t> m_output;
std::mutex m_outputMutex;
std::condition_variable m_outputCondition;
};
} // namespace tests_support
} // namespace platform

View file

@ -1,4 +1,6 @@
#include "std/string.hpp"
#pragma once
#include <string>
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;
};

View file

@ -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 <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -16,6 +12,13 @@
#include <cstring>
#include <unistd.h>
#include <algorithm>
#include <cstring>
#include <memory>
#include <regex>
using namespace std;
#if defined(GEOCORE_OS_MAC)
#include <sys/mount.h>
#else

View file

@ -1,10 +1,10 @@
#pragma once
#include "std/string.hpp"
#include "std/vector.hpp"
#include <string>
#include <vector>
namespace pl
{
void EnumerateFilesByRegExp(string const & directory, string const & regexp,
vector<string> & res);
}
void EnumerateFilesByRegExp(std::string const & directory, std::string const & regexp,
std::vector<std::string> & res);
} // namespace pl

View file

@ -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 <CoreFoundation/CFLocale.h>
@ -15,6 +13,12 @@
#include <cstdlib>
#endif
#include <vector>
#include <set>
#include <string>
using namespace std;
namespace languages
{

View file

@ -1,31 +1,24 @@
#pragma once
#include "std/string.hpp"
#include <string>
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

View file

@ -14,10 +14,9 @@
#include "base/logging.hpp"
#include "std/cmath.hpp"
#include "std/iostream.hpp"
#include "std/sstream.hpp"
#include <cmath>
#include <iostream>
#include <sstream>
using namespace std;

View file

@ -4,7 +4,7 @@
#include "base/macros.hpp"
#include "std/string.hpp"
#include <string>
namespace settings
{
@ -14,9 +14,10 @@ extern char const * kLocationStateMode;
extern char const * kMeasurementUnits;
template <class T>
bool FromString(string const & str, T & outValue);
bool FromString(std::string const & str, T & outValue);
template <class T>
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 <class Value>
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 <class Value>
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 <class Value>
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 <class Value>
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 <class Value>
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);
}

View file

@ -1,8 +1,8 @@
#pragma once
#include "std/cstdint.hpp"
#include "std/string.hpp"
#include "std/unique_ptr.hpp"
#include <cstdint>
#include <memory>
#include <string>
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<Socket> CreateSocket();
std::unique_ptr<Socket> CreateSocket();
} // namespace platform

View file

@ -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<Socket> CreateSocket()
std::unique_ptr<Socket> CreateSocket()
{
return make_unique<PlatformSocket>();
return std::make_unique<PlatformSocket>();
}
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];
}

View file

@ -1,48 +0,0 @@
#pragma once
#include <algorithm>
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;

View file

@ -1,6 +0,0 @@
#pragma once
#include <atomic>
using std::atomic;
using std::atomic_flag;

View file

@ -1,15 +0,0 @@
#pragma once
#include <functional>
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;

View file

@ -1,5 +0,0 @@
#pragma once
#include <cctype>
using std::isdigit;

View file

@ -1,17 +0,0 @@
#pragma once
#include <chrono>
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;

View file

@ -1,10 +0,0 @@
#pragma once
// We do not define _USE_MATH_DEFINES - please add your constants below.
#include <cmath>
using std::abs;
using std::cos;
using std::isfinite;
using std::sin;
using std::log10;

View file

@ -1,6 +0,0 @@
#pragma once
#include <condition_variable>
using std::condition_variable;
using std::cv_status;

View file

@ -1,12 +0,0 @@
#pragma once
#include <cstdint>
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;

View file

@ -1,4 +0,0 @@
#pragma once
#include <deque>
using std::deque;

View file

@ -1,5 +0,0 @@
#pragma once
#include <functional>
using std::function;
using std::greater;

View file

@ -1,5 +0,0 @@
#pragma once
#include <initializer_list>
using std::initializer_list;
using StringIL = initializer_list<char const *>;

View file

@ -1,16 +0,0 @@
#pragma once
#include <iostream>
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;

View file

@ -1,18 +0,0 @@
#pragma once
#include <iterator>
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;

View file

@ -1,6 +0,0 @@
#pragma once
#include <boost/iterator/iterator_facade.hpp>
using boost::iterator_facade;
using boost::random_access_traversal_tag;
using boost::forward_traversal_tag;

View file

@ -1,4 +0,0 @@
#pragma once
#include <list>
using std::list;

View file

@ -1,8 +0,0 @@
#pragma once
#include <mutex>
using std::lock_guard;
using std::mutex;
using std::timed_mutex;
using std::unique_lock;

View file

@ -1,9 +0,0 @@
#pragma once
#include <regex>
using std::regex;
using std::regex_match;
using std::regex_search;
using std::sregex_token_iterator;
using std::regex_replace;

View file

@ -1,5 +0,0 @@
#pragma once
#include <set>
using std::multiset;
using std::set;

View file

@ -1,4 +0,0 @@
#pragma once
#include <boost/shared_array.hpp>
using boost::shared_array;

View file

@ -1,6 +0,0 @@
#pragma once
#include <memory>
using std::shared_ptr;
using std::make_shared;
using std::enable_shared_from_this;

View file

@ -1,8 +0,0 @@
#pragma once
#include <sstream>
using std::istringstream;
using std::ostringstream;
using std::stringstream;
using std::endl;

View file

@ -1,10 +0,0 @@
#pragma once
#include <string>
using std::basic_string;
using std::getline;
using std::stoi;
using std::stod;
using std::string;
using std::to_string;

View file

@ -1,4 +0,0 @@
#pragma once
#include <boost/iterator/transform_iterator.hpp>
using boost::make_transform_iterator;

View file

@ -1,5 +0,0 @@
#pragma once
#include <memory>
using std::unique_ptr;
using std::make_unique;

View file

@ -1,5 +0,0 @@
#pragma once
#include <unordered_map>
using std::unordered_map;
using std::unordered_multimap;

View file

@ -1,5 +0,0 @@
#pragma once
#include <unordered_set>
using std::unordered_set;
using std::unordered_multiset;

View file

@ -1,8 +0,0 @@
#pragma once
#include <utility>
using std::forward;
using std::make_pair;
using std::move;
using std::pair;

View file

@ -1,4 +0,0 @@
#pragma once
#include <vector>
using std::vector;