Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: webrtc/base/pathutils.cc

Issue 2745073004: Delete unused Pathname methods. (Closed)
Patch Set: Add back Pathname::clear, it's used in the windows code. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/pathutils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/pathutils.cc
diff --git a/webrtc/base/pathutils.cc b/webrtc/base/pathutils.cc
index f79c2980a42d04981d662897493842b8ea48815f..75dabb53e4e351674150823e6d77d98b8bb268b8 100644
--- a/webrtc/base/pathutils.cc
+++ b/webrtc/base/pathutils.cc
@@ -70,11 +70,6 @@ Pathname::Pathname(const std::string& folder, const std::string& filename)
Pathname& Pathname::operator=(const Pathname&) = default;
Pathname& Pathname::operator=(Pathname&&) = default;
-void Pathname::SetFolderDelimiter(char delimiter) {
- RTC_DCHECK(IsFolderDelimiter(delimiter));
- folder_delimiter_ = delimiter;
-}
-
void Pathname::Normalize() {
for (size_t i=0; i<folder_.length(); ++i) {
if (IsFolderDelimiter(folder_[i])) {
@@ -122,28 +117,10 @@ void Pathname::SetPathname(const std::string& folder,
SetFilename(filename);
}
-void Pathname::AppendPathname(const std::string& pathname) {
- std::string full_pathname(folder_);
- full_pathname.append(pathname);
- SetPathname(full_pathname);
-}
-
std::string Pathname::folder() const {
return folder_;
}
-std::string Pathname::folder_name() const {
- std::string::size_type pos = std::string::npos;
- if (folder_.size() >= 2) {
- pos = folder_.find_last_of(FOLDER_DELIMS, folder_.length() - 2);
- }
- if (pos != std::string::npos) {
- return folder_.substr(pos + 1);
- } else {
- return folder_;
- }
-}
-
std::string Pathname::parent_folder() const {
std::string::size_type pos = std::string::npos;
if (folder_.size() >= 2) {
@@ -172,10 +149,6 @@ void Pathname::AppendFolder(const std::string& folder) {
}
}
-std::string Pathname::basename() const {
- return basename_;
-}
-
bool Pathname::SetBasename(const std::string& basename) {
if(basename.find_first_of(FOLDER_DELIMS) != std::string::npos) {
return false;
@@ -184,10 +157,6 @@ bool Pathname::SetBasename(const std::string& basename) {
return true;
}
-std::string Pathname::extension() const {
- return extension_;
-}
-
bool Pathname::SetExtension(const std::string& extension) {
if (extension.find_first_of(FOLDER_DELIMS) != std::string::npos ||
extension.find_first_of(EXT_DELIM, 1) != std::string::npos) {
@@ -216,29 +185,6 @@ bool Pathname::SetFilename(const std::string& filename) {
}
}
-#if defined(WEBRTC_WIN)
-bool Pathname::GetDrive(char* drive, uint32_t bytes) const {
- return GetDrive(drive, bytes, folder_);
-}
-
-// static
-bool Pathname::GetDrive(char* drive,
- uint32_t bytes,
- const std::string& pathname) {
- // need at lease 4 bytes to save c:
- if (bytes < 4 || pathname.size() < 3) {
- return false;
- }
-
- memcpy(drive, pathname.c_str(), 3);
- drive[3] = 0;
- // sanity checking
- return (isalpha(drive[0]) &&
- drive[1] == ':' &&
- drive[2] == '\\');
-}
-#endif
-
///////////////////////////////////////////////////////////////////////////////
} // namespace rtc
« no previous file with comments | « webrtc/base/pathutils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698