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

Comparing trunk/Zoe.cpp (file contents):
Revision 59 by douglas, 2004-09-13T23:39:30-07:00 vs.
Revision 63 by douglas, 2004-09-17T16:35:17-07:00

# Line 10 | Line 10
10  
11   #include <menes-api/exename.hpp>
12   #include <menes-app/application.hpp>
13 + #include <menes-ios/stdadapters.hpp>
14  
15   #include <algorithm>
16   #include <cstring>
# Line 67 | Line 68 | Zoe::Zoe()
68          if (!(collector || publisher)) usage();
69          
70          configure();
70        initialize();
71  
72          Collector collector(login, password, buddies, database, Zoe::collector);
73          Publisher publisher(buddies, database, Zoe::publisher);
# Line 79 | Line 79 | ext::String Zoe::program, Zoe::config("z
79  
80   void Zoe::usage()
81   {
82 <        cerr << "Usage: " << Zoe::program << " [-config=config] [-collector] "
82 >        api::Cerr << "Usage: " << Zoe::program << " [-config=config] [-collector] "
83                  "[-publisher] [-color] [-D]\n";
84  
85          exit(1);
# Line 124 | Line 124 | ext::String Zoe::generator(Generator gen
124  
125   void Zoe::configure()
126   {
127 <        if (debug) cerr << "config = " << config << '\n';
127 >        if (debug) api::Cerr << "config = " << config << "\n";
128  
129          ext::Handle<xml::Document> document(xml::Parse(config));
130          ext::Handle<xml::Node> zoe(*document/"zoe");
# Line 151 | Line 151 | void Zoe::configure()
151  
152          database.db = *zoe/"database"/"db";
153  
154 <        if (debug) cerr << "login = " << login << "\npassword = "
154 >        if (debug) api::Cerr << "login = " << login << "\npassword = "
155                  << std::string(password.GetSize(), '*') << "\ndatabase = {\n"
156                  << "   driver = " << database.driver << "\n   host = " << database.host
157 <                << "\n   user = " << database.user << '\n'
157 >                << "\n   user = " << database.user << "\n"
158                  << "   password = " << std::string(database.password.GetSize(), '*')
159                  << "\n   db = " << database.db << "\n}\n";
160  
# Line 171 | Line 171 | void Zoe::configure()
171                  this->buddies.insert(buddy_);
172          }
173  
174 +        initialize();
175 +
176          if (debug)
177          {
178 <                cerr << "buddies = {\n";
178 >                api::Cerr << "buddies = {\n";
179  
180                  for (std::set<Buddy>::const_iterator buddy(this->buddies.begin());
181                          buddy != this->buddies.end(); ++buddy)
182                  {
183 <                        cerr << "   " << *buddy << " = {\n      rss = " << buddy->getRss()
184 <                                << "\n      atom = " << buddy->getAtom() << "\n      link = "
185 <                                << buddy->getLink() << "\n   }\n";
183 >                        api::Cerr << "   " << *buddy << " = {\n      rss = "
184 >                                << buddy->getRss() << "\n      atom = " << buddy->getAtom()
185 >                                << "\n      link = " << buddy->getLink() << "\n      id = "
186 >                                << buddy->getId() << "\n   }\n";
187                  }
188  
189 <                cerr << "}\n";
189 >                api::Cerr << "}\n";
190          }
191  
192 <        if (debug) cerr << "collector = " << lexical_cast<ext::String>(collector)
193 <                << "\npublisher = " << lexical_cast<ext::String>(publisher)
191 <                << "\ncolor = " << lexical_cast<ext::String>(color) << '\n';
192 >        if (debug) api::Cerr << "collector = " << collector << "\npublisher = "
193 >                << publisher << "\ncolor = " << color << "\n";
194   }
195  
196   void Zoe::initialize()
# Line 219 | Line 221 | void Zoe::initialize()
221          for (std::vector<Buddy>::iterator buddy(difference.begin());
222                  buddy != difference.end(); ++buddy)
223          {
224 <                ext::Uuid id;
224 >                ext::Uuid id(api::Uuid::CreateSequential());
225  
226 <                api::Uuid::CreateSequential(id);
226 > //              api::Uuid::CreateSequential(id);
227  
228                  buddy->setId(id);
229                  db->Execute("INSERT INTO buddies (id, buddy) VALUES ('"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines