Skip to content

Commit

Permalink
Got rid of the old style std/ includes for several files.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana-yan authored and mpimenov committed Sep 19, 2019
1 parent 2dc866c commit e04fc71
Show file tree
Hide file tree
Showing 22 changed files with 94 additions and 79 deletions.
12 changes: 7 additions & 5 deletions mapshot/mapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

#include "base/string_utils.hpp"

#include "std/exception.hpp"
#include "std/fstream.hpp"
#include "std/iomanip.hpp"
#include "std/iostream.hpp"
#include "std/string.hpp"
#include <exception>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <string>

#include "3party/gflags/src/gflags/gflags.h"

Expand All @@ -29,6 +29,8 @@ DEFINE_int32(width, 480, "Resulting image width");
DEFINE_int32(height, 640, "Resulting image height");
//----------------------------------------------------------------------------------------

using namespace std;

namespace
{
struct Place
Expand Down
6 changes: 4 additions & 2 deletions openlr/openlr_model_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

#include "base/logging.hpp"

#include "std/cstring.hpp"
#include "std/type_traits.hpp"
#include <cstring>
#include <type_traits>

#include "boost/optional.hpp"

#include "3party/pugixml/src/pugixml.hpp"

using namespace std;

namespace // Primitive utilities to handle simple OpenLR-like XML data.
{
template <typename Value>
Expand Down
4 changes: 2 additions & 2 deletions openlr/openlr_model_xml.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "std/vector.hpp"
#include <vector>

namespace pugi
{
Expand All @@ -14,5 +14,5 @@ struct LinearSegment;

bool SegmentFromXML(pugi::xml_node const & segmentNode, LinearSegment & segment);

bool ParseOpenlr(pugi::xml_document const & document, vector<LinearSegment> & segments);
bool ParseOpenlr(pugi::xml_document const & document, std::vector<LinearSegment> & segments);
} // namespace openlr
2 changes: 0 additions & 2 deletions openlr/openlr_stat/openlr_stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "base/file_name_utils.hpp"
#include "base/stl_helpers.hpp"

#include "std/unique_ptr.hpp"

#include <algorithm>
#include <cstdint>
#include <cstdio>
Expand Down
2 changes: 1 addition & 1 deletion storage/storage_integration_tests/migrate_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "base/string_utils.hpp"
#include "base/thread.hpp"

#include "std/string.hpp"
#include <cstdint>

using namespace platform;
using namespace storage;
Expand Down
9 changes: 4 additions & 5 deletions storage/storage_integration_tests/storage_3levels_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

#include "base/file_name_utils.hpp"

#include "std/algorithm.hpp"
#include "std/unique_ptr.hpp"
#include <string>

#include "defines.hpp"

Expand All @@ -19,7 +18,7 @@ using namespace storage;

namespace
{
string const kCountryId = "Germany"; // Germany has 3-levels hierachy
std::string const kCountryId = "Germany"; // Germany has 3-levels hierachy

int GetLevelCount(Storage & storage, CountryId const & countryId)
{
Expand All @@ -41,12 +40,12 @@ UNIT_TEST(SmallMwms_3levels_Test)

Framework f(FrameworkParams(false /* m_enableLocalAds */, false /* m_enableDiffs */));
auto & storage = f.GetStorage();
string const version = strings::to_string(storage.GetCurrentDataVersion());
std::string const version = strings::to_string(storage.GetCurrentDataVersion());
TEST(version::IsSingleMwm(storage.GetCurrentDataVersion()), ());

TEST_EQUAL(3, GetLevelCount(storage, kCountryId), ());

string const mapDir = base::JoinPath(platform.WritableDir(), version);
std::string const mapDir = base::JoinPath(platform.WritableDir(), version);

auto onProgressFn = [&](CountryId const & countryId, LocalAndRemoteSize const & mapSize) {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
#include "base/assert.hpp"
#include "base/file_name_utils.hpp"

#include "std/condition_variable.hpp"
#include "std/mutex.hpp"
#include "std/set.hpp"
#include "std/unique_ptr.hpp"
#include <string>

using namespace platform;
using namespace std;
using namespace storage;

namespace
Expand Down
3 changes: 2 additions & 1 deletion storage/storage_integration_tests/storage_http_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#include "base/string_utils.hpp"
#include "base/thread.hpp"

#include "std/string.hpp"
#include <string>

using namespace platform;
using namespace std;
using namespace storage;

namespace
Expand Down
4 changes: 3 additions & 1 deletion storage/storage_integration_tests/storage_update_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

#include "base/file_name_utils.hpp"

#include "std/unique_ptr.hpp"
#include <memory>
#include <string>

using namespace platform;
using namespace std;
using namespace storage;

namespace
Expand Down
4 changes: 2 additions & 2 deletions storage/storage_integration_tests/test_defines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

namespace storage
{
string const kMapTestDir = string("map-tests");
string const kTestWebServer = string("http://direct.mapswithme.com/");
std::string const kMapTestDir = "map-tests";
std::string const kTestWebServer = "http://direct.mapswithme.com/";
} // namespace storage
6 changes: 3 additions & 3 deletions storage/storage_integration_tests/test_defines.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "std/string.hpp"
#include <string>

namespace storage
{
extern string const kMapTestDir;
extern string const kTestWebServer;
extern std::string const kMapTestDir;
extern std::string const kTestWebServer;
} // namespace storage
6 changes: 4 additions & 2 deletions storage/storage_tests/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@

#include "platform/platform.hpp"

#include <memory>

namespace storage
{
unique_ptr<CountryInfoGetter> CreateCountryInfoGetterObsolete()
std::unique_ptr<CountryInfoGetter> CreateCountryInfoGetterObsolete()
{
return CountryInfoReader::CreateCountryInfoReaderObsolete(GetPlatform());
}

unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter()
std::unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter()
{
return CountryInfoReader::CreateCountryInfoReader(GetPlatform());
}
Expand Down
6 changes: 3 additions & 3 deletions storage/storage_tests/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

#include "geometry/mercator.hpp"

#include "std/unique_ptr.hpp"
#include <memory>

namespace storage
{
class CountryInfoGetter;

unique_ptr<CountryInfoGetter> CreateCountryInfoGetterObsolete();
unique_ptr<CountryInfoGetter> CreateCountryInfoGetter();
std::unique_ptr<CountryInfoGetter> CreateCountryInfoGetterObsolete();
std::unique_ptr<CountryInfoGetter> CreateCountryInfoGetter();

bool AlmostEqualRectsAbs(const m2::RectD & r1, const m2::RectD & r2);
} // namespace storage
3 changes: 0 additions & 3 deletions storage/storage_tests/test_map_files_downloader.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "storage/storage_tests/test_map_files_downloader.hpp"

#include "std/string.hpp"
#include "std/vector.hpp"

namespace storage
{
void TestMapFilesDownloader::GetServersList(ServersListCallback const & callback)
Expand Down
4 changes: 2 additions & 2 deletions tracking/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ uint32_t constexpr kSocketTimeoutMs = 10000;

namespace tracking
{
Connection::Connection(unique_ptr<platform::Socket> socket, string const & host, uint16_t port,
bool isHistorical)
Connection::Connection(std::unique_ptr<platform::Socket> socket, std::string const & host,
uint16_t port, bool isHistorical)
: m_socket(move(socket)), m_host(host), m_port(port)
{
if (!m_socket)
Expand Down
13 changes: 6 additions & 7 deletions tracking/connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

#include "coding/traffic.hpp"

#include "std/cstdint.hpp"
#include "std/string.hpp"
#include "std/unique_ptr.hpp"
#include "std/vector.hpp"
#include <cstdint>
#include <memory>
#include <string>

#if defined(__clang__)
#pragma clang diagnostic push
Expand All @@ -30,15 +29,15 @@ using DataPoint = coding::TrafficGPSEncoder::DataPoint;
class Connection final
{
public:
Connection(unique_ptr<platform::Socket> socket, string const & host, uint16_t port,
Connection(std::unique_ptr<platform::Socket> socket, std::string const & host, uint16_t port,
bool isHistorical);
bool Reconnect();
void Shutdown();
bool Send(boost::circular_buffer<DataPoint> const & points);

private:
unique_ptr<platform::Socket> m_socket;
string const m_host;
std::unique_ptr<platform::Socket> m_socket;
std::string const m_host;
uint16_t const m_port;
};
} // namespace tracking
6 changes: 3 additions & 3 deletions tracking/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

#include "base/assert.hpp"

#include "std/cstdint.hpp"
#include "std/sstream.hpp"
#include "std/utility.hpp"
#include <sstream>

using namespace std;

namespace
{
Expand Down
26 changes: 14 additions & 12 deletions tracking/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

#include "coding/traffic.hpp"

#include "std/string.hpp"
#include "std/vector.hpp"
#include <cstdint>
#include <string>
#include <utility>
#include <vector>

#if defined(__clang__)
#pragma clang diagnostic push
Expand All @@ -23,7 +25,7 @@ class Protocol
public:
using Encoder = coding::TrafficGPSEncoder;
using DataElementsCirc = boost::circular_buffer<Encoder::DataPoint>;
using DataElementsVec = vector<Encoder::DataPoint>;
using DataElementsVec = std::vector<Encoder::DataPoint>;

static uint8_t const kOk[4];
static uint8_t const kFail[4];
Expand All @@ -38,18 +40,18 @@ class Protocol
CurrentData = DataV1
};

static vector<uint8_t> CreateHeader(PacketType type, uint32_t payloadSize);
static vector<uint8_t> CreateAuthPacket(string const & clientId);
static vector<uint8_t> CreateDataPacket(DataElementsCirc const & points, PacketType type);
static vector<uint8_t> CreateDataPacket(DataElementsVec const & points, PacketType type);
static std::vector<uint8_t> CreateHeader(PacketType type, uint32_t payloadSize);
static std::vector<uint8_t> CreateAuthPacket(std::string const & clientId);
static std::vector<uint8_t> CreateDataPacket(DataElementsCirc const & points, PacketType type);
static std::vector<uint8_t> CreateDataPacket(DataElementsVec const & points, PacketType type);

static std::pair<PacketType, size_t> DecodeHeader(vector<uint8_t> const & data);
static string DecodeAuthPacket(PacketType type, vector<uint8_t> const & data);
static DataElementsVec DecodeDataPacket(PacketType type, vector<uint8_t> const & data);
static std::pair<PacketType, size_t> DecodeHeader(std::vector<uint8_t> const & data);
static std::string DecodeAuthPacket(PacketType type, std::vector<uint8_t> const & data);
static DataElementsVec DecodeDataPacket(PacketType type, std::vector<uint8_t> const & data);

private:
static void InitHeader(vector<uint8_t> & packet, PacketType type, uint32_t payloadSize);
static void InitHeader(std::vector<uint8_t> & packet, PacketType type, uint32_t payloadSize);
};

string DebugPrint(Protocol::PacketType type);
std::string DebugPrint(Protocol::PacketType type);
} // namespace tracking
3 changes: 3 additions & 0 deletions tracking/reporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#include <cmath>

using namespace std;
using namespace std::chrono;

namespace
{
double constexpr kRequiredHorizontalAccuracy = 10.0;
Expand Down
Loading

0 comments on commit e04fc71

Please sign in to comment.