Changeset 293 for AE/Installer/trunk/source/methods.h
- Timestamp:
- Apr 4, 2009, 10:14:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/methods.h
r292 r293 6 6 7 7 struct ModPackage { 8 bool isInstalled; //replace with function 9 string *name; 8 bool isInstalled; //replace with function 9 string name; 10 string modString; 11 bool hasOnis; 12 bool hasDeltas; 13 bool hasBSL; 14 bool hasDats; 15 bool category; 16 string creator; 17 bool isEngine; 18 string readme; 19 bool globalNeeded; 10 20 }; 11 21 12 22 int mainMenu(); 13 23 vector<ModPackage> getPackages(); 14 ModPackage fileToModPackage(fstream );24 ModPackage fileToModPackage(fstream&); 15 25 16 26 void installPackages(); … … 20 30 bool getDirectoryContents(char , char &); 21 31 32 33 void Tokenize(const string& str, 34 vector<string>& tokens, 35 const string& delimiters = " ") 36 { 37 // Skip delimiters at beginning. 38 string::size_type lastPos = str.find_first_not_of(delimiters, 0); 39 // Find first "non-delimiter". 40 string::size_type pos = str.find_first_of(delimiters, lastPos); 41 42 while (string::npos != pos || string::npos != lastPos) 43 { 44 // Found a token, add it to the vector. 45 tokens.push_back(str.substr(lastPos, pos - lastPos)); 46 // Skip delimiters. Note the "not_of" 47 lastPos = str.find_first_not_of(delimiters, pos); 48 // Find next "non-delimiter" 49 pos = str.find_first_of(delimiters, lastPos); 50 } 51 }
Note:
See TracChangeset
for help on using the changeset viewer.