source: AE/Installer/trunk/source/methods.h @ 293

Last change on this file since 293 was 293, checked in by gumby, 12 years ago

Worked on reader.
Expanded struct ModPackage

File size: 1.3 KB
Line 
1#include <string>
2#include <vector>
3#include <fstream>
4
5using namespace std;
6
7struct ModPackage {
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
22int mainMenu();
23vector<ModPackage> getPackages();
24ModPackage fileToModPackage(fstream&);
25
26void installPackages();
27void uninstallPackages();
28void getInstalledPackages();
29
30bool getDirectoryContents(char , char &);
31
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 TracBrowser for help on using the repository browser.