diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-11-15 17:51:29 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-11-15 17:51:29 -0800 |
commit | f906959a09d58c85d87b445fd1791d91bf278bfa (patch) | |
tree | b65282b2c731d4eb2157ae719828cddf6b086943 /src/map/skill.cpp | |
parent | 1fb7ce5a604db78c4d02f719053827269705ce13 (diff) | |
download | tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.gz tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.bz2 tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.tar.xz tmwa-f906959a09d58c85d87b445fd1791d91bf278bfa.zip |
Use new IO classes
Diffstat (limited to 'src/map/skill.cpp')
-rw-r--r-- | src/map/skill.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/map/skill.cpp b/src/map/skill.cpp index ab5f55b..9187335 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -5,15 +5,14 @@ #include <cstring> #include <ctime> -#include <fstream> - #include "../strings/mstring.hpp" #include "../strings/fstring.hpp" #include "../strings/xstring.hpp" +#include "../io/read.hpp" + #include "../common/cxxstdio.hpp" #include "../common/extract.hpp" -#include "../common/io.hpp" #include "../common/nullpo.hpp" #include "../common/random.hpp" #include "../common/socket.hpp" @@ -1186,15 +1185,15 @@ int skill_readdb(void) for (skill_db_& skdb : skill_db) skdb = skill_db_{}; - std::ifstream in("db/skill_db.txt"); - if (!in) + io::ReadFile in("db/skill_db.txt"); + if (!in.is_open()) { PRINTF("can't read db/skill_db.txt\n"); return 1; } FString line_; - while (io::getline(in, line_)) + while (in.getline(line_)) { XString comment = "//"; XString line = line_.xislice_h(std::search(line_.begin(), line_.end(), comment.begin(), comment.end())).rstrip(); |