ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Spectre/Configurator.cpp
(Generate patch)

Comparing trunk/Spectre/Configurator.cpp (file contents):
Revision 162 by douglas, 2003-06-09T22:01:14-07:00 vs.
Revision 163 by douglas, 2003-06-13T21:10:47-07:00

# Line 17 | Line 17 | void Configurator::configurate()
17   {
18          if (config.hosts.count(host) < 2)
19          {
20 <                cerr << program << ": No configuration for " << host << "\n";
20 >                cerr << program << ": No configuration for host: " << host << "\n";
21                  exit(1);
22          }
23  
# Line 26 | Line 26 | void Configurator::configurate()
26                  itor++)
27          {
28                  string entry = itor->second;
29 <
29 >                
30                  if (entry.find("passwd=") == 0)
31                  {
32 <                        //
32 >                        istringstream sin(entry.substr(7));
33 >
34 >                        do
35 >                        {
36 >                                string item;
37 >                                getline(sin, item, ',');
38 >
39 >                                if (item == "file")
40 >                                {
41 >                                        passwd.push_back(file);
42 >                                }
43 >                                else if (item == "prompt")
44 >                                {
45 >                                        passwd.push_back(prompt);
46 >                                }
47 >                        }
48 >                        while (sin.good());
49                  }
50                  else if (entry.find("folder=") == 0)
51                  {
52 <                        //
52 >                        istringstream sin(entry.substr(7));
53 >
54 >                        string folder;
55 >                        getline(sin, folder, ':');
56 >
57 >                        string local;
58 >                        getline(sin, local, ':');
59 >
60 >                        string remote;
61 >                        getline(sin, remote);
62 >
63 >                        if (folder == "*")
64 >                        {
65 >                                regular.local = local;
66 >                                regular.remote = remote;
67 >                        }
68 >                        else
69 >                        {
70 >                                Folder special;
71 >                                
72 >                                special.local = local;
73 >                                special.remote = remote;
74 >
75 >                                folders.insert(pair<string, Folder>(folder, special));
76 >                        }
77                  }
78                  else
79                  {
80 <                        cerr << program << ": Unknown configuration " << entry
81 <                           << ", ignored\n";
80 >                        cerr << program << ": Unknown configuration entry: \"" << entry
81 >                           << "\", ignored\n";
82                  }
83          }
84   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines