Beispiel #1
0
void LocationParser_br::parsePathData(ZonePtr z) {
	TypeData *data = &z->u;
	if (!scumm_stricmp("zone", _tokens[0])) {
		int id = atoi(_tokens[1]);
		parsePointList(data->_pathLists[id]);
		data->_pathNumLists++;
	}
}
vector< pair<int,int> > parsePointListFile(const string& filename) {
	// from http://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring
	// n.b. bad performance for files over 50kb
	std::ifstream t(filename);
	std::stringstream buffer;
	buffer << t.rdbuf();

	return parsePointList(buffer.str());
}
vector< pair<int,int> > parsePointList(const string& s) {
	string::const_iterator p = s.begin();
	string::const_iterator end = s.end();

	return parsePointList(p, end);
}