Hauptseite | Liste aller Namensbereiche | Klassenhierarchie | Übersicht | Auflistung der Dateien | Elemente eines Namensbereiches | Datenstruktur-Elemente | Datei-Elemente

psfaAdmin.cpp Dateireferenz

#include <iostream>
#include <string>
#include "psfa/Admin.hpp"

Include-Abhängigkeitsdiagramm für psfaAdmin.cpp:

Include dependency graph

gehe zum Quellcode dieser Datei

Funktionen

void usage ()
int main (int argc, char *argv[])


Dokumentation der Funktionen

int main int  argc,
char *  argv[]
 

Definiert in Zeile 28 der Datei psfaAdmin.cpp.

Benutzt psfa::Admin::check(), psfa::Admin::del(), psfa::Admin::index(), psfa::Admin::init(), psfa::Admin::isSuccess() und usage().

00030 {
00031   using std::cout;
00032   using std::endl;
00033   using std::string;
00034     
00035   if ( argc < 2 ) {
00036     usage();
00037     return 0;
00038   }
00039 
00040   enum Action { UNKNOWN, INIT, INDEX, DELETE, CHECK };
00041 
00042   Action action = UNKNOWN;
00043   const string arg1 = argv[1];
00044   
00045   if ( arg1 == "init" ) {
00046     action = INIT;
00047   }
00048   else if ( arg1 == "index" ) {
00049     action = INDEX;
00050   }
00051   else if ( arg1 == "delete" ) {
00052     action = DELETE;
00053   }
00054   else if ( arg1 == "check" ) {
00055     action = CHECK;
00056   }
00057   
00058   string pool;
00059   psfa::Admin admin;
00060   
00061   switch ( action ) {
00062   case INIT :
00063     switch( argc ) {
00064     case 2 :
00065       cout << "Initialisiere die DB" << endl;
00066       admin.init();
00067       break;
00068     default :
00069       usage();
00070       return 1;
00071     }
00072     break;
00073   case INDEX :
00074     switch( argc ) {
00075     case 3:
00076       pool = argv[2];
00077       cout << "Indiziere den Pool " << pool << endl;
00078       admin.index( pool );
00079       break;
00080     default:
00081       usage();
00082       return 1;
00083     }
00084     break;
00085   case DELETE :
00086     switch( argc ) {
00087     case 3 :
00088       pool = argv[2];
00089       cout << "Lösche den Pool " << pool << endl;
00090       admin.del( pool );
00091       break;
00092     default :
00093       usage();
00094       return 1;
00095     }
00096     break;
00097   case CHECK:
00098     switch( argc ) {
00099     case 2 :
00100       cout << "Überprüfe die DB" << endl;
00101       admin.check();
00102       break;
00103     default :
00104       usage();
00105       return 1;
00106     }
00107     break;
00108   default :
00109     usage();
00110     return 1;
00111   }
00112   
00113   if( !admin.isSuccess() ) {
00114     return 1;
00115   }
00116   return 0;
00117 }

void usage  ) 
 

Definiert in Zeile 122 der Datei psfaAdmin.cpp.

Wird benutzt von main().

00123 {
00124     using std::cout;
00125     using std::endl;
00126     
00127     cout << "\n"
00128     << "psfa - administriert das Indizierungssystem\n"
00129     << "psfa Aktion [Parameter]\n"
00130     << "Aktion:\n"
00131     << "init        - initialisiert die DB "
00132     << "und bereitet sie auf die Indizierung vor\n"
00133     << "delete pool - löscht den Pool pool\n"
00134     << "index pool  - indiziert den Pool pool\n"
00135     << "check       - überprüft, ob die DB noch aktuell ist\n"
00136     << endl;
00137     return;
00138 }


Erzeugt am Mon Jul 12 11:45:07 2004 für PSFA von doxygen 1.3.4