Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

MenuItem.cpp

00001 //Licence: LGPL 00002 //Copyright: Visti Andresen 00003 00004 #include "MenuItem.h" 00005 00006 bool MenuItem::findLoadPosition(const string &name, ifstream &file) 00007 { 00008 file.clear(); 00009 file.seekg(0); 00010 if (!file.good()){ 00011 cout << "bad file\n"; 00012 } 00013 //cout << "entering read\n"; 00014 while(file.good()){ 00015 string fileName=""; 00016 char c='w'; 00017 while (file.good() && c!='='){ 00018 //cout << "reading " << c<<endl; 00019 file.read(&c, 1); 00020 if (c!='=') fileName += c; 00021 } 00022 if (name == fileName) { 00023 //cout << "found " << fileName << endl; 00024 return true; 00025 } 00026 //cout << "looking for " << name << " found " << fileName<< endl; 00027 00028 //scan for next entry 00029 while (file.good() && c!='\n'){ 00030 file.read(&c,1); 00031 } 00032 00033 } 00034 cout << "no config for " << name << endl; 00035 return false; 00036 }

Generated on Wed Sep 1 14:46:57 2004 by doxygen 1.3.7