From 1dffc62843286148288f482ef77d98342ba7d3d3 Mon Sep 17 00:00:00 2001 From: ehmaldonado Date: Thu, 2 Feb 2017 08:10:00 -0800 Subject: [PATCH] Remove all occurrences of "using std::string". BUG=webrtc:7104 NOTRY=True Review-Url: https://codereview.webrtc.org/2675723002 Cr-Commit-Position: refs/heads/master@{#16418} --- .../audio_coding/neteq/test/neteq_ilbc_quality_test.cc | 1 - .../audio_coding/neteq/test/neteq_isac_quality_test.cc | 1 - .../audio_coding/neteq/test/neteq_opus_quality_test.cc | 1 - .../audio_coding/neteq/test/neteq_pcmu_quality_test.cc | 1 - .../audio_coding/neteq/tools/neteq_quality_test.cc | 9 ++++----- .../remote_bitrate_estimators_test.cc | 2 -- .../modules/remote_bitrate_estimator/test/bwe_test.cc | 10 +++++----- webrtc/tools/frame_analyzer/video_quality_analysis.cc | 10 ++++------ webrtc/tools/frame_editing/frame_editing_lib.cc | 6 ++---- webrtc/tools/simple_command_line_parser.cc | 8 +++----- 10 files changed, 18 insertions(+), 31 deletions(-) diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc index fdbe39cce2..1c6d2ca797 100644 --- a/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc +++ b/webrtc/modules/audio_coding/neteq/test/neteq_ilbc_quality_test.cc @@ -18,7 +18,6 @@ using google::RegisterFlagValidator; using google::ParseCommandLineFlags; -using std::string; using testing::InitGoogleTest; namespace webrtc { diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc index 62bfc1b3cb..8506e326cb 100644 --- a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc +++ b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc @@ -13,7 +13,6 @@ using google::RegisterFlagValidator; using google::ParseCommandLineFlags; -using std::string; using testing::InitGoogleTest; namespace webrtc { diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc index a6117a4c5b..eac8476c83 100644 --- a/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc +++ b/webrtc/modules/audio_coding/neteq/test/neteq_opus_quality_test.cc @@ -14,7 +14,6 @@ using google::RegisterFlagValidator; using google::ParseCommandLineFlags; -using std::string; using testing::InitGoogleTest; namespace webrtc { diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc index 8c7e5b7a93..27350abaa3 100644 --- a/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc +++ b/webrtc/modules/audio_coding/neteq/test/neteq_pcmu_quality_test.cc @@ -18,7 +18,6 @@ using google::RegisterFlagValidator; using google::ParseCommandLineFlags; -using std::string; using testing::InitGoogleTest; namespace webrtc { diff --git a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc index eee586d1dd..0b4edc6026 100644 --- a/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc +++ b/webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc @@ -18,8 +18,6 @@ #include "webrtc/modules/audio_coding/neteq/tools/resample_input_audio_file.h" #include "webrtc/test/testsupport/fileutils.h" -using std::string; - namespace webrtc { namespace test { @@ -29,7 +27,7 @@ const int kInitSeed = 0x12345678; const int kPacketLossTimeUnitMs = 10; // Common validator for file names. -static bool ValidateFilename(const string& value, bool write) { +static bool ValidateFilename(const std::string& value, bool write) { FILE* fid = write ? fopen(value.c_str(), "wb") : fopen(value.c_str(), "rb"); if (fid == nullptr) return false; @@ -38,7 +36,7 @@ static bool ValidateFilename(const string& value, bool write) { } // Define switch for input file name. -static bool ValidateInFilename(const char* flagname, const string& value) { +static bool ValidateInFilename(const char* flagname, const std::string& value) { if (!ValidateFilename(value, false)) { printf("Invalid input filename."); return false; @@ -82,7 +80,8 @@ static const bool channels_dummy = RegisterFlagValidator(&FLAGS_channels, &ValidateChannels); // Define switch for output file name. -static bool ValidateOutFilename(const char* flagname, const string& value) { +static bool ValidateOutFilename(const char* flagname, + const std::string& value) { if (!ValidateFilename(value, true)) { printf("Invalid output filename."); return false; diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc index a486bce503..37c2d04f0b 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc @@ -24,8 +24,6 @@ #include "webrtc/modules/remote_bitrate_estimator/test/packet_sender.h" #include "webrtc/test/testsupport/fileutils.h" -using std::string; - namespace webrtc { namespace testing { namespace bwe { diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc index 40711106cc..13959fc0c5 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test.cc @@ -22,7 +22,6 @@ #include "webrtc/system_wrappers/include/clock.h" #include "webrtc/test/testsupport/perf_test.h" -using std::string; using std::vector; namespace webrtc { @@ -113,8 +112,9 @@ BweTest::~BweTest() { void BweTest::SetUp() { const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); - string test_name = - string(test_info->test_case_name()) + "_" + string(test_info->name()); + std::string test_name = + std::string(test_info->test_case_name()) + "_" + + std::string(test_info->name()); BWE_TEST_LOGGING_GLOBAL_CONTEXT(test_name); BWE_TEST_LOGGING_GLOBAL_ENABLE(false); } @@ -181,10 +181,10 @@ void BweTest::RunFor(int64_t time_ms) { } } -string BweTest::GetTestName() const { +std::string BweTest::GetTestName() const { const ::testing::TestInfo* const test_info = ::testing::UnitTest::GetInstance()->current_test_info(); - return string(test_info->name()); + return std::string(test_info->name()); } void BweTest::PrintResults(double max_throughput_kbps, diff --git a/webrtc/tools/frame_analyzer/video_quality_analysis.cc b/webrtc/tools/frame_analyzer/video_quality_analysis.cc index dfb7d90065..d1b0e314e1 100644 --- a/webrtc/tools/frame_analyzer/video_quality_analysis.cc +++ b/webrtc/tools/frame_analyzer/video_quality_analysis.cc @@ -26,8 +26,6 @@ namespace webrtc { namespace test { -using std::string; - ResultsContainer::ResultsContainer() {} ResultsContainer::~ResultsContainer() {} @@ -44,13 +42,13 @@ int GetI420FrameSize(int width, int height) { int ExtractFrameSequenceNumber(std::string line) { size_t space_position = line.find(' '); - if (space_position == string::npos) { + if (space_position == std::string::npos) { return -1; } std::string frame = line.substr(0, space_position); size_t underscore_position = frame.find('_'); - if (underscore_position == string::npos) { + if (underscore_position == std::string::npos) { return -1; } std::string frame_number = frame.substr(underscore_position + 1); @@ -60,7 +58,7 @@ int ExtractFrameSequenceNumber(std::string line) { int ExtractDecodedFrameNumber(std::string line) { size_t space_position = line.find(' '); - if (space_position == string::npos) { + if (space_position == std::string::npos) { return -1; } std::string decoded_number = line.substr(space_position + 1); @@ -70,7 +68,7 @@ int ExtractDecodedFrameNumber(std::string line) { bool IsThereBarcodeError(std::string line) { size_t barcode_error_position = line.find("Barcode error"); - if (barcode_error_position != string::npos) { + if (barcode_error_position != std::string::npos) { return true; } return false; diff --git a/webrtc/tools/frame_editing/frame_editing_lib.cc b/webrtc/tools/frame_editing/frame_editing_lib.cc index bb6a75edaa..f68dc1ffe9 100644 --- a/webrtc/tools/frame_editing/frame_editing_lib.cc +++ b/webrtc/tools/frame_editing/frame_editing_lib.cc @@ -18,13 +18,11 @@ #include "webrtc/tools/frame_editing/frame_editing_lib.h" #include "webrtc/typedefs.h" -using std::string; - namespace webrtc { -int EditFrames(const string& in_path, int width, int height, +int EditFrames(const std::string& in_path, int width, int height, int first_frame_to_process, int interval, - int last_frame_to_process, const string& out_path) { + int last_frame_to_process, const std::string& out_path) { if (last_frame_to_process < first_frame_to_process) { fprintf(stderr, "The set of frames to cut is empty! (l < f)\n"); return -10; diff --git a/webrtc/tools/simple_command_line_parser.cc b/webrtc/tools/simple_command_line_parser.cc index 62aba3d04f..863e7a904d 100644 --- a/webrtc/tools/simple_command_line_parser.cc +++ b/webrtc/tools/simple_command_line_parser.cc @@ -18,8 +18,6 @@ namespace webrtc { namespace test { -using std::string; - CommandLineParser::CommandLineParser() {} CommandLineParser::~CommandLineParser() {} @@ -28,7 +26,7 @@ void CommandLineParser::Init(int argc, char** argv) { } bool CommandLineParser::IsStandaloneFlag(std::string flag) { - return flag.find("=") == string::npos; + return flag.find("=") == std::string::npos; } bool CommandLineParser::IsFlagWellFormed(std::string flag) { @@ -55,7 +53,7 @@ bool CommandLineParser::IsFlagWellFormed(std::string flag) { std::string CommandLineParser::GetCommandLineFlagName(std::string flag) { size_t dash_pos = flag.find("--"); size_t equal_pos = flag.find("="); - if (equal_pos == string::npos) { + if (equal_pos == std::string::npos) { return flag.substr(dash_pos + 2); } else { return flag.substr(dash_pos + 2, equal_pos - 2); @@ -64,7 +62,7 @@ std::string CommandLineParser::GetCommandLineFlagName(std::string flag) { std::string CommandLineParser::GetCommandLineFlagValue(std::string flag) { size_t equal_pos = flag.find("="); - if (equal_pos == string::npos) { + if (equal_pos == std::string::npos) { return ""; } else { return flag.substr(equal_pos + 1);