diff options
Diffstat (limited to 'core/os/file_access.cpp')
-rw-r--r-- | core/os/file_access.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 375121c0cc..805b66b983 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -252,6 +252,27 @@ double FileAccess::get_double() const { return m.d; }; +String FileAccess::get_token() const { + + CharString token; + + CharType c = get_8(); + + while (!eof_reached()) { + + if (c <= ' ') { + if (!token.empty()) + break; + } else { + token.push_back(c); + } + c = get_8(); + } + + token.push_back(0); + return String::utf8(token.get_data()); +} + String FileAccess::get_line() const { CharString line; |