From 064eaaed391835d0e0d057466f6f552e43e79bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Neuwirth?= Date: Wed, 27 May 2009 16:43:43 +0200 Subject: add cdatset --- ue4/mycpu/cmem.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ue4/mycpu/cmem.h') diff --git a/ue4/mycpu/cmem.h b/ue4/mycpu/cmem.h index 6b23111..c6b8735 100644 --- a/ue4/mycpu/cmem.h +++ b/ue4/mycpu/cmem.h @@ -13,6 +13,7 @@ #include #include #include +#include #ifdef DEBUG # include # include @@ -23,7 +24,7 @@ * * Extends std::vector template for use as memory for CCPU. */ -template +template, int width=0> class CMem : public std::vector { @@ -55,7 +56,8 @@ class CMem { ++i; std::getline(in, line); - + boost::algorithm::trim(line); + /* skip last line if it's empty */ if (line.empty() && in.eof()) break; @@ -63,8 +65,9 @@ class CMem T value; try { - if (!line.empty()) - value = boost::lexical_cast(line); + if (!line.empty()) + { + value = boost::lexical_cast(line); } catch(boost::bad_lexical_cast& ex) { -- cgit v1.2.3