summaryrefslogtreecommitdiff
path: root/src/gtest-filepath.cc
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-01 18:53:56 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-09-01 18:53:56 +0000
commit89be5763249cbab785abfa310fb1cd6b5e9c4adf (patch)
treeb37d320ebcd5e50efe61d26ae0e7ed4916cf7334 /src/gtest-filepath.cc
parent34e42df5b87572c93fea8e4ada2b2b437fbfe4e4 (diff)
downloadgtest-89be5763249cbab785abfa310fb1cd6b5e9c4adf.tar.gz
gtest-89be5763249cbab785abfa310fb1cd6b5e9c4adf.tar.bz2
gtest-89be5763249cbab785abfa310fb1cd6b5e9c4adf.tar.xz
Enables String to contain NUL (by Zhanyong Wan); Adds scons scripts (by Vlad Losev).
git-svn-id: http://googletest.googlecode.com/svn/trunk@300 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src/gtest-filepath.cc')
-rw-r--r--src/gtest-filepath.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gtest-filepath.cc b/src/gtest-filepath.cc
index f966352..ef74236 100644
--- a/src/gtest-filepath.cc
+++ b/src/gtest-filepath.cc
@@ -103,7 +103,7 @@ FilePath FilePath::GetCurrentDir() {
FilePath FilePath::RemoveExtension(const char* extension) const {
String dot_extension(String::Format(".%s", extension));
if (pathname_.EndsWithCaseInsensitive(dot_extension.c_str())) {
- return FilePath(String(pathname_.c_str(), pathname_.GetLength() - 4));
+ return FilePath(String(pathname_.c_str(), pathname_.length() - 4));
}
return *this;
}
@@ -217,7 +217,7 @@ bool FilePath::IsRootDirectory() const {
// TODO(wan@google.com): on Windows a network share like
// \\server\share can be a root directory, although it cannot be the
// current directory. Handle this properly.
- return pathname_.GetLength() == 3 && IsAbsolutePath();
+ return pathname_.length() == 3 && IsAbsolutePath();
#else
return pathname_ == kPathSeparatorString;
#endif
@@ -227,7 +227,7 @@ bool FilePath::IsRootDirectory() const {
bool FilePath::IsAbsolutePath() const {
const char* const name = pathname_.c_str();
#if GTEST_OS_WINDOWS
- return pathname_.GetLength() >= 3 &&
+ return pathname_.length() >= 3 &&
((name[0] >= 'a' && name[0] <= 'z') ||
(name[0] >= 'A' && name[0] <= 'Z')) &&
name[1] == ':' &&
@@ -271,7 +271,7 @@ bool FilePath::CreateDirectoriesRecursively() const {
return false;
}
- if (pathname_.GetLength() == 0 || this->DirectoryExists()) {
+ if (pathname_.length() == 0 || this->DirectoryExists()) {
return true;
}
@@ -307,7 +307,7 @@ bool FilePath::CreateFolder() const {
// On Windows platform, uses \ as the separator, other platforms use /.
FilePath FilePath::RemoveTrailingPathSeparator() const {
return pathname_.EndsWith(kPathSeparatorString)
- ? FilePath(String(pathname_.c_str(), pathname_.GetLength() - 1))
+ ? FilePath(String(pathname_.c_str(), pathname_.length() - 1))
: *this;
}
@@ -320,9 +320,9 @@ void FilePath::Normalize() {
return;
}
const char* src = pathname_.c_str();
- char* const dest = new char[pathname_.GetLength() + 1];
+ char* const dest = new char[pathname_.length() + 1];
char* dest_ptr = dest;
- memset(dest_ptr, 0, pathname_.GetLength() + 1);
+ memset(dest_ptr, 0, pathname_.length() + 1);
while (*src != '\0') {
*dest_ptr++ = *src;