summaryrefslogtreecommitdiff
path: root/goo
diff options
context:
space:
mode:
authorOliver Sander <oliver.sander@tu-dresden.de>2018-11-09 18:42:04 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2018-11-11 22:07:02 +0000
commit817b0f12453985c416a0388cdd4a09697d092b7f (patch)
tree10c369ab08ee87097a9691daa0633cbc8a92a4da /goo
parentfb7f34b1f9706c4912384eabd5dbf44b6c88c71d (diff)
Rename GooString::getCString GooString::c_str
This is the name used by std::string.
Diffstat (limited to 'goo')
-rw-r--r--goo/GooString.cc2
-rw-r--r--goo/GooString.h2
-rw-r--r--goo/gfile.cc32
3 files changed, 18 insertions, 18 deletions
diff --git a/goo/GooString.cc b/goo/GooString.cc
index 1c8d08c2..e1fff699 100644
--- a/goo/GooString.cc
+++ b/goo/GooString.cc
@@ -454,7 +454,7 @@ GooString *GooString::appendfv(const char *fmt, va_list argList) {
reverseAlign = !reverseAlign;
break;
case fmtGooString:
- str = arg.gs->getCString();
+ str = arg.gs->c_str();
len = arg.gs->getLength();
reverseAlign = !reverseAlign;
break;
diff --git a/goo/GooString.h b/goo/GooString.h
index b5160cf7..e7cc9ce7 100644
--- a/goo/GooString.h
+++ b/goo/GooString.h
@@ -128,7 +128,7 @@ public:
int getLength() const { return size(); }
// Get C string.
- const char *getCString() const { return c_str(); }
+ using std::string::c_str;
// Get <i>th character.
char getChar(int i) const { return (*this)[i]; }
diff --git a/goo/gfile.cc b/goo/gfile.cc
index 125cbed2..819559c0 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -112,7 +112,7 @@ GooString *appendToPath(GooString *path, const char *fileName) {
char *p0, *p1, *p2;
char *q1;
- p0 = path->getCString();
+ p0 = path->c_str();
p1 = p0 + path->getLength() - 1;
if (!strcmp(fileName, "-")) {
if (*p1 == ']') {
@@ -154,7 +154,7 @@ GooString *appendToPath(GooString *path, const char *fileName) {
tmp = new GooString(path);
tmp->append('/');
tmp->append(fileName);
- GetFullPathNameA(tmp->getCString(), sizeof(buf), buf, &fp);
+ GetFullPathNameA(tmp->c_str(), sizeof(buf), buf, &fp);
delete tmp;
path->clear();
path->append(buf);
@@ -168,7 +168,7 @@ GooString *appendToPath(GooString *path, const char *fileName) {
path->append(".");
i = path->getLength();
path->append(fileName);
- for (p = path->getCString() + i; *p; ++p) {
+ for (p = path->c_str() + i; *p; ++p) {
if (*p == '/') {
*p = '.';
} else if (*p == '.') {
@@ -185,7 +185,7 @@ GooString *appendToPath(GooString *path, const char *fileName) {
path->append(":");
i = path->getLength();
path->append(fileName);
- for (p = path->getCString() + i; *p; ++p) {
+ for (p = path->c_str() + i; *p; ++p) {
if (*p == '/') {
*p = ':';
} else if (*p == '.') {
@@ -434,7 +434,7 @@ Goffset GooFile::size() const {
}
GooFile* GooFile::open(const GooString *fileName) {
- HANDLE handle = CreateFileA(fileName->getCString(),
+ HANDLE handle = CreateFileA(fileName->c_str(),
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
nullptr,
@@ -483,9 +483,9 @@ Goffset GooFile::size() const {
GooFile* GooFile::open(const GooString *fileName) {
#ifdef VMS
- int fd = ::open(fileName->getCString(), Q_RDONLY, "ctx=stm");
+ int fd = ::open(fileName->c_str(), Q_RDONLY, "ctx=stm");
#else
- int fd = ::open(fileName->getCString(), O_RDONLY);
+ int fd = ::open(fileName->c_str(), O_RDONLY);
#endif
return fd < 0 ? nullptr : new GooFile(fd);
@@ -535,10 +535,10 @@ GDirEntry::GDirEntry(const char *dirPath, const char *nameA, bool doStat) {
#elif defined(ACORN)
#else
#ifdef _WIN32
- fa = GetFileAttributesA(fullPath->getCString());
+ fa = GetFileAttributesA(fullPath->c_str());
dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
#else
- if (stat(fullPath->getCString(), &st) == 0)
+ if (stat(fullPath->c_str(), &st) == 0)
dir = S_ISDIR(st.st_mode);
#endif
#endif
@@ -558,7 +558,7 @@ GDir::GDir(const char *name, bool doStatA) {
tmp = path->copy();
tmp->append("/*.*");
- hnd = FindFirstFileA(tmp->getCString(), &ffd);
+ hnd = FindFirstFileA(tmp->c_str(), &ffd);
delete tmp;
#elif defined(ACORN)
#elif defined(MACOS)
@@ -590,7 +590,7 @@ GDirEntry *GDir::getNextEntry() {
#if defined(_WIN32)
if (hnd != INVALID_HANDLE_VALUE) {
- e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
+ e = new GDirEntry(path->c_str(), ffd.cFileName, doStat);
if (!FindNextFileA(hnd, &ffd)) {
FindClose(hnd);
hnd = INVALID_HANDLE_VALUE;
@@ -602,13 +602,13 @@ GDirEntry *GDir::getNextEntry() {
struct dirent *ent;
if (dir) {
if (needParent) {
- e = new GDirEntry(path->getCString(), "-", doStat);
+ e = new GDirEntry(path->c_str(), "-", doStat);
needParent = false;
return e;
}
ent = readdir(dir);
if (ent) {
- e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ e = new GDirEntry(path->c_str(), ent->d_name, doStat);
}
}
#else
@@ -619,7 +619,7 @@ GDirEntry *GDir::getNextEntry() {
}
while (ent && (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")));
if (ent) {
- e = new GDirEntry(path->getCString(), ent->d_name, doStat);
+ e = new GDirEntry(path->c_str(), ent->d_name, doStat);
}
}
#endif
@@ -635,7 +635,7 @@ void GDir::rewind() {
FindClose(hnd);
tmp = path->copy();
tmp->append("/*.*");
- hnd = FindFirstFileA(tmp->getCString(), &ffd);
+ hnd = FindFirstFileA(tmp->c_str(), &ffd);
delete tmp;
#elif defined(ACORN)
#elif defined(MACOS)
@@ -643,7 +643,7 @@ void GDir::rewind() {
if (dir)
rewinddir(dir);
#ifdef VMS
- needParent = strchr(path->getCString(), '[') != NULL;
+ needParent = strchr(path->c_str(), '[') != NULL;
#endif
#endif
}