Replace rtc::Optional with absl::optional in test and rtc_tools
This is a no-op change because rtc::Optional is an alias to absl::optional
This CL generated by running script with parameters 'test rtc_tools'
find $@ -type f \( -name \*.h -o -name \*.cc \) \
-exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \
-exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \
-exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+
find $@ -type f -name BUILD.gn \
-exec sed -r -i 's|"(../)*api:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+;
git cl format
Bug: webrtc:9078
Change-Id: Ibb43c737f4c45fe300736382b0dd2d8ab32c6377
Reviewed-on: https://webrtc-review.googlesource.com/83944
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23642}
diff --git a/test/testsupport/fileutils.cc b/test/testsupport/fileutils.cc
index 7ba24c1..76a635a 100644
--- a/test/testsupport/fileutils.cc
+++ b/test/testsupport/fileutils.cc
@@ -223,9 +223,9 @@
return filename;
}
-rtc::Optional<std::vector<std::string>> ReadDirectory(std::string path) {
+absl::optional<std::vector<std::string>> ReadDirectory(std::string path) {
if (path.length() == 0)
- return rtc::Optional<std::vector<std::string>>();
+ return absl::optional<std::vector<std::string>>();
#if defined(WEBRTC_WIN)
// Append separator character if needed.
@@ -236,7 +236,7 @@
WIN32_FIND_DATA data;
HANDLE handle = ::FindFirstFile(rtc::ToUtf16(path + '*').c_str(), &data);
if (handle == INVALID_HANDLE_VALUE)
- return rtc::Optional<std::vector<std::string>>();
+ return absl::optional<std::vector<std::string>>();
// Populate output.
std::vector<std::string> found_entries;
@@ -257,7 +257,7 @@
// Init.
DIR* dir = ::opendir(path.c_str());
if (dir == nullptr)
- return rtc::Optional<std::vector<std::string>>();
+ return absl::optional<std::vector<std::string>>();
// Populate output.
std::vector<std::string> found_entries;
@@ -271,7 +271,7 @@
closedir(dir);
#endif
- return rtc::Optional<std::vector<std::string>>(std::move(found_entries));
+ return absl::optional<std::vector<std::string>>(std::move(found_entries));
}
bool CreateDir(const std::string& directory_name) {