Ignore:
Timestamp:
Apr 4, 2009, 10:14:05 PM (16 years ago)
Author:
gumby
Message:

Worked on reader.
Expanded struct ModPackage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • AE/Installer/trunk/source/methods.h

    r292 r293  
    66
    77struct 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;
    1020};
    1121
    1222int mainMenu();
    1323vector<ModPackage> getPackages();
    14 ModPackage fileToModPackage(fstream);
     24ModPackage fileToModPackage(fstream&);
    1525
    1626void installPackages();
     
    2030bool getDirectoryContents(char , char &);
    2131
     32
     33void 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.