projects
/
hackover2013-badge-firmware.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanity-convert: add Makefile
[hackover2013-badge-firmware.git]
/
mock
/
tools
/
level-converter.cc
diff --git
a/mock/tools/level-converter.cc
b/mock/tools/level-converter.cc
index
eccd3e0
..
eb8b1c6
100644
(file)
--- a/
mock/tools/level-converter.cc
+++ b/
mock/tools/level-converter.cc
@@
-6,6
+6,7
@@
extern "C" {
}
#include <boost/spirit/include/qi_symbols.hpp>
}
#include <boost/spirit/include/qi_symbols.hpp>
+#include <boost/algorithm/string/trim.hpp>
#include <algorithm>
#include <fstream>
#include <algorithm>
#include <fstream>
@@
-21,7
+22,7
@@
enum {
LEVEL_LINE_COUNT = 14
};
LEVEL_LINE_COUNT = 14
};
-#define PATH_PREFIX "../badge/jumpnrun/"
+#define PATH_PREFIX "../badge/jumpnrun/
levels/
"
namespace jnrcpp {
struct descriptors {
namespace jnrcpp {
struct descriptors {
@@
-69,15
+70,15
@@
namespace jnrcpp {
struct level_name_map {
level_name_map() {
struct level_name_map {
level_name_map() {
- std::ifstream in(
PATH_PREFIX
"levels.txt");
+ std::ifstream in("levels.txt");
if(!in) {
if(!in) {
- throw std::logic_error(
PATH_PREFIX
"levels.txt konnte nicht geöffnet werden.");
+ throw std::logic_error("levels.txt konnte nicht geöffnet werden.");
}
std::string name;
while(std::getline(in, name)) {
}
std::string name;
while(std::getline(in, name)) {
- if(
name
!= "") {
+ if(
boost::trim_copy(name)
!= "") {
names.push_back(name);
}
}
names.push_back(name);
}
}
@@
-119,7
+120,7
@@
namespace jnrcpp {
} else {
throw std::invalid_argument("Unkown type: " + line);
}
} else {
throw std::invalid_argument("Unkown type: " + line);
}
- } else if(
line
!= "") {
+ } else if(
boost::trim_right_copy(line)
!= "") {
char c;
std::string tok;
std::istringstream parser(line);
char c;
std::string tok;
std::istringstream parser(line);
This page took
0.023482 seconds
and
4
git commands to generate.