diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-06-29 23:23:43 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-01 15:19:45 -0700 |
commit | 3b98f3439e33b15bba2036c402f9925340fdb2b9 (patch) | |
tree | f6a59330bb747d9cc64f5f83d06e7f76dc01d540 /src/common/extract.cpp | |
parent | 8d1480c1be7c9741876d89008277a2b3629a4d01 (diff) | |
download | tmwa-3b98f3439e33b15bba2036c402f9925340fdb2b9.tar.gz tmwa-3b98f3439e33b15bba2036c402f9925340fdb2b9.tar.bz2 tmwa-3b98f3439e33b15bba2036c402f9925340fdb2b9.tar.xz tmwa-3b98f3439e33b15bba2036c402f9925340fdb2b9.zip |
Poison std::string and use the various string classes
Diffstat (limited to 'src/common/extract.cpp')
-rw-r--r-- | src/common/extract.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/common/extract.cpp b/src/common/extract.cpp index 5e89e19..720e6df 100644 --- a/src/common/extract.cpp +++ b/src/common/extract.cpp @@ -18,28 +18,31 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -bool extract(const_string str, const_string *rv) +#include "../poison.hpp" + +bool extract(XString str, XString *rv) { *rv = str; return true; } -bool extract(const_string str, std::string *rv) +bool extract(XString str, FString *rv) { - *rv = std::string(str.begin(), str.end()); + *rv = str; return true; } -bool extract(const_string str, struct global_reg *var) +bool extract(XString str, struct global_reg *var) { return extract(str, record<','>(&var->str, &var->value)); } -bool extract(const_string str, struct item *it) +bool extract(XString str, struct item *it) { + it->broken = 0; return extract(str, - record<','>( + record<',', 11>( &it->id, &it->nameid, &it->amount, @@ -51,18 +54,5 @@ bool extract(const_string str, struct item *it) &it->card[1], &it->card[2], &it->card[3], - &it->broken)) - || extract(str, - record<','>( - &it->id, - &it->nameid, - &it->amount, - &it->equip, - &it->identify, - &it->refine, - &it->attribute, - &it->card[0], - &it->card[1], - &it->card[2], - &it->card[3])); + &it->broken)); } |