fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
std::stringcolumn="";
std::stringcolumn="";
std::vector<std::string>data;
std::vector<std::string>data;
//HACK ALERT! If the number of recipes for any of these exceeds 300, a reallocation occurs and all pointers move...
//HACK ALERT! If the number of recipes for any of these exceeds 300, a reallocation occurs and all pointers move...
@ -315,118 +313,119 @@ public:
ScrollProdRecipes.reserve(300);
ScrollProdRecipes.reserve(300);
CompRecipes.reserve(300);
CompRecipes.reserve(300);
DecompRecipes.reserve(300);
DecompRecipes.reserve(300);
for(inti=0;i<fileContents.size();i++){
while(file.good()){
if(fileContents[i]=='\t'){
std::stringline;
data.push_back(column);
std::getline(file,line);
column="";
for(inti=0;i<line.size();i++){
}else
if(line[i]=='\t'){
if(fileContents[i]=='\n'){
data.push_back(column);
data.push_back(column);
column="";
column="";
if(data.size()!=25){
std::cout<<"Data size was "<<data.size()<<"! Expected 25 columns..."<<std::endl;
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
column="";
column="";
data.clear();
data.clear();
for(inti=0;i<fileContents.size();i++){
while(file.good()){
if(fileContents[i]=='\t'){
std::stringline;
data.push_back(column);
std::getline(file,line);
column="";
for(inti=0;i<line.size();i++){
}else
if(line[i]=='\t'){
if(fileContents[i]=='\n'){
data.push_back(column);
data.push_back(column);
column="";
column="";
if(data.size()!=27){
std::cout<<"Data size was "<<data.size()<<"! Expected 27 columns..."<<std::endl;
fileContents+='\n';//HACK ALERT! Our parser does not deal with data until a '\n' character occurs. If the file has no \n on the last line, we won't process it. This hack fixes that.
column="";
column="";
data.clear();
data.clear();
for(inti=0;i<fileContents.size();i++){
while(file.good()){
if(fileContents[i]=='\t'){
std::stringline;
data.push_back(column);
std::getline(file,line);
column="";
for(inti=0;i<line.size();i++){
}else
if(line[i]=='\t'){
if(fileContents[i]=='\n'){
data.push_back(column);
data.push_back(column);
column="";
column="";
if(data.size()!=57){
std::cout<<"Data size was "<<data.size()<<"! Expected 57 columns..."<<std::endl;
for(inti=0;i<data.size();i++){
std::cout<<"Col "<<i+1<<":"<<data[i]<<std::endl;
}
returnfalse;
}else{
}else{
//Recipe r(data);
column+=line[i];
std::stringproduct=data[1];
}
if(IDToName.find(product)!=IDToName.end()){
}
IDToName[product].name=data[2];
data.push_back(column);
}
column="";
if(data.size()!=57){
std::cout<<"Data size was "<<data.size()<<"! Expected 57 columns..."<<std::endl;