Rename Common::Stream::readLine_NEW to readLine

svn-id: r46779
This commit is contained in:
Max Horn 2009-12-30 23:00:55 +00:00
parent 47f48dd912
commit d083e02215
7 changed files with 14 additions and 14 deletions

View File

@ -94,7 +94,7 @@ enum {
CR = 0x0D
};
char *SeekableReadStream::readLine_NEW(char *buf, size_t bufSize) {
char *SeekableReadStream::readLine(char *buf, size_t bufSize) {
assert(buf != 0 && bufSize > 1);
char *p = buf;
size_t len = 0;
@ -162,7 +162,7 @@ String SeekableReadStream::readLine() {
String line;
while (line.lastChar() != '\n') {
char buf[256];
if (!readLine_NEW(buf, 256))
if (!readLine(buf, 256))
break;
line += buf;
}

View File

@ -374,7 +374,7 @@ public:
* @param bufSize the size of the buffer
* @return a pointer to the read string, or NULL if an error occurred
*/
virtual char *readLine_NEW(char *s, size_t bufSize);
virtual char *readLine(char *s, size_t bufSize);
/**

View File

@ -224,7 +224,7 @@ static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) {
error("fgets_wrapper: Trying to read from file '%s' opened for writing", f->_name.c_str());
return;
}
f->_in->readLine_NEW(dest, maxsize);
f->_in->readLine(dest, maxsize);
// The returned string must not have an ending LF
int strSize = strlen(dest);
if (strSize > 0) {

View File

@ -117,7 +117,7 @@ bool ResourceManager::init() {
char *buf = _resFiles[_totalClusters].fileName;
uint len = sizeof(_resFiles[_totalClusters].fileName);
if (!file.readLine_NEW(buf, len))
if (!file.readLine(buf, len))
break;
int pos = strlen(buf);

View File

@ -977,7 +977,7 @@ void Screen::rollCredits() {
while (1) {
char buffer[80];
char *line = f.readLine_NEW(buffer, sizeof(buffer));
char *line = f.readLine(buffer, sizeof(buffer));
if (line) {
// Replace invalid character codes prevent the 'dud'

View File

@ -524,7 +524,7 @@ int bdf_read_bitmaps(Common::SeekableReadStream &fp, NewFontData* pf) {
}
/* read the next non-comment line, returns buf or NULL if EOF*/
// TODO: Can we use SeekableReadStream::readLine resp. readLine_NEW instead?
// TODO: Can we use SeekableReadStream::readLine instead?
char *bdf_getline(Common::SeekableReadStream &fp, char *buf, int len) {
int c;
char *b;

View File

@ -10,18 +10,18 @@ class ReadLineStreamTestSuite : public CxxTest::TestSuite {
char buffer[100];
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "ab\n"));
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "\n"));
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "c\n"));
TS_ASSERT(!ms.eos());
TS_ASSERT_EQUALS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT(ms.eos());
}
@ -32,13 +32,13 @@ class ReadLineStreamTestSuite : public CxxTest::TestSuite {
char buffer[100];
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "ab\n"));
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "\n"));
TS_ASSERT_DIFFERS((char *)0, ms.readLine_NEW(buffer, sizeof(buffer)));
TS_ASSERT_DIFFERS((char *)0, ms.readLine(buffer, sizeof(buffer)));
TS_ASSERT_EQUALS(0, strcmp(buffer, "c"));
TS_ASSERT(ms.eos());