summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-12-16 15:56:14 +0100
committerAdam Borowski <kilobyte@angband.pl>2010-12-16 16:53:03 +0100
commitad3bbac308f31e2c8bef95e921152f34f00cc785 (patch)
tree8315917941e95878b6788b17603ecabbbd39df1c /crawl-ref/source/initfile.h
parentc182b846613a797cb37fcda578553e40814b7e65 (diff)
downloadcrawl-ref-ad3bbac308f31e2c8bef95e921152f34f00cc785.tar.gz
crawl-ref-ad3bbac308f31e2c8bef95e921152f34f00cc785.zip
Rename TextFileReader to FileLineInput I didn't notice, use it for config files.
Diffstat (limited to 'crawl-ref/source/initfile.h')
-rw-r--r--crawl-ref/source/initfile.h35
1 files changed, 3 insertions, 32 deletions
diff --git a/crawl-ref/source/initfile.h b/crawl-ref/source/initfile.h
index 18d77d0df6..99d172e655 100644
--- a/crawl-ref/source/initfile.h
+++ b/crawl-ref/source/initfile.h
@@ -12,6 +12,7 @@
#include <cstdio>
#include "enum.h"
+#include "unicode.h"
enum drop_mode_type
{
@@ -27,7 +28,6 @@ std::string read_init_file(bool runscript = false);
struct newgame_def;
newgame_def read_startup_prefs();
-void read_options(FILE *f, bool runscript = false);
void read_options(const std::string &s, bool runscript = false,
bool clear_aliases = false);
@@ -84,36 +84,7 @@ std::string channel_to_str(int ch);
int str_to_channel(const std::string &);
-class InitLineInput
-{
-public:
- virtual ~InitLineInput() { }
- virtual bool eof() = 0;
- virtual std::string getline() = 0;
-};
-
-class FileLineInput : public InitLineInput
-{
-public:
- FileLineInput(FILE *f) : file(f) { }
-
- bool eof()
- {
- return !file || feof(file);
- }
-
- std::string getline()
- {
- char s[256] = "";
- if (!eof())
- fgets(s, sizeof s, file);
- return (s);
- }
-private:
- FILE *file;
-};
-
-class StringLineInput : public InitLineInput
+class StringLineInput : public LineInput
{
public:
StringLineInput(const std::string &s) : str(s), pos(0) { }
@@ -123,7 +94,7 @@ public:
return pos >= str.length();
}
- std::string getline()
+ std::string get_line()
{
if (eof())
return "";