aboutsummaryrefslogtreecommitdiff
path: root/dep/g3dlite/source/TextInput.cpp
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2012-09-03 15:39:07 +0100
committerNay <dnpd.dd@gmail.com>2012-09-03 15:39:07 +0100
commit0db5573d4de436cf14c9f6d113a28800fa278c2c (patch)
tree884581461cb17266400355c3152a2c9be81cadc2 /dep/g3dlite/source/TextInput.cpp
parent5f6e190a9677cda78d6b975f46df979941bb6f1f (diff)
Core/Dependencies: Update G3D to version 8.01
Diffstat (limited to 'dep/g3dlite/source/TextInput.cpp')
-rw-r--r--dep/g3dlite/source/TextInput.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/dep/g3dlite/source/TextInput.cpp b/dep/g3dlite/source/TextInput.cpp
index 09abacc7391..354d0de13c0 100644
--- a/dep/g3dlite/source/TextInput.cpp
+++ b/dep/g3dlite/source/TextInput.cpp
@@ -128,32 +128,34 @@ Token TextInput::read() {
}
-std::string TextInput::readUntilNewlineAsString() {
- // Go to the front of the next token
- Token t = read();
- // Reset the position to the start of this token
+std::string TextInput::readUntilNewlineAsString() {
+/*
+ // Reset the read position back to the start of that token
currentCharOffset = t.bytePosition();
+ lineNumber = t.line();
+ charNumber = t.character();
stack.clear();
if (currentCharOffset == buffer.size()) {
// End of file
return "";
}
-
+ */
std::string s;
// Read until newline or eof
char c = '\0';
do {
- c = buffer[currentCharOffset];
- if (c == '\r' || c == '\n') {
- // Done
- break;
- } else {
- s += c;
- ++currentCharOffset;
- }
+ c = buffer[currentCharOffset];
+ if (c == '\r' || c == '\n') {
+ // Done
+ break;
+ } else {
+ s += c;
+ ++currentCharOffset;
+ ++charNumber;
+ }
} while (currentCharOffset < buffer.size());
return s;