ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/methods.h
(Generate patch)

Comparing AE/Installer/trunk/source/methods.h (file contents):
Revision 292 by gumby, Sat Apr 4 08:13:56 2009 UTC vs.
Revision 293 by gumby, Sat Apr 4 20:14:05 2009 UTC

# Line 5 | Line 5
5   using namespace std;
6  
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;
20   };
21  
22   int mainMenu();
23   vector<ModPackage> getPackages();
24 < ModPackage fileToModPackage(fstream);
24 > ModPackage fileToModPackage(fstream&);
25  
26   void installPackages();
27   void uninstallPackages();
# Line 19 | Line 29 | void getInstalledPackages();
29  
30   bool getDirectoryContents(char , char &);
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 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)