home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / hl10osrc.lzh / PrintCards / PrintCards.h < prev   
Text File  |  1994-04-23  |  3KB  |  74 lines

  1. // PrintCards.h - autogenerated from PrintCards.arg on Sat Apr 23 14:52:41 1994
  2. // Do not edit this file!  Re-run makeargprc to re-generate
  3.  
  4. #ifndef VERSION
  5. #define VERSION "V0.0"
  6. #endif
  7.  
  8. class PrintCards {
  9. public:
  10.              PrintCards(int argc,char** argv);
  11.         void Usage();
  12.         char* infile; // The name of the file to print records from
  13.         Boolean infile_passed;
  14.         Boolean largep; // If true, print large cards, else print small cards
  15.         Boolean largep_passed;
  16.         char* by; // Should be one of {Id, Title, Author, Subject} - selects card type.
  17.         Boolean by_passed;
  18.         char* only; // selection expression 
  19.         Boolean only_passed;
  20. };
  21.  
  22. void PrintCards::Usage()
  23. {
  24.         cout << "Syntax: PrintCards [opts]\n";
  25.         cout << "Libraian Card Catalog card printer\n";
  26.         cout << "This program is used to print out cards\n";
  27.         cout << "Prints either large (5x8) or small cards (3x5)\n";
  28.         cout << "Prints \"Shelf List\" (by=Id), Title reference (by=Title),\n";
  29.         cout << "Author reference (by=Author), or Subject reference\n";
  30.         cout << "(by=Subject).  By default a \"Shelf List\" is printed.\n";
  31.         cout << "Options:\n";
  32.         cout << "-infile\tString Required The name of the file to print records from\n";
  33.         cout << "-largep\tBoolean Optional If true, print large cards, else print small cards\n";
  34.         cout << "-by\tString Optional Should be one of {Id, Title, Author, Subject} - selects card type.\n";
  35.         cout << "-only\tString Optional selection expression \n";
  36.         cout << "\n\tVersion: " << VERSION << "\n";        cout << "\tCopyright (c) 1991,1992 Robert Heller D/B/A Deepwoods Software\n";}
  37.  
  38. PrintCards::PrintCards(int argc,char** argv)
  39. {
  40.         infile_passed = false;
  41.         largep_passed = false;
  42.         by_passed = false;
  43.         only_passed = false;
  44.         for (int iarg=1;iarg<argc;iarg++) {
  45.             if (strcmp(argv[iarg],"-?") == 0 ||
  46.                 strcmp(argv[iarg],"-U") == 0) {
  47.                 Usage(); exit(0);
  48.             } else if (strcmp(argv[iarg],"-infile") == 0 && (iarg+1) < argc) {
  49.                 iarg++;
  50.                 infile_passed = true;
  51.                 infile = argv[iarg];
  52.             } else if (strcmp(argv[iarg],"-largep") == 0 && (iarg+1) < argc) {
  53.                 iarg++;
  54.                 largep_passed = true;
  55.                 largep = *argv[iarg] == 't' || *argv[iarg] == 'T';
  56.             } else if (strcmp(argv[iarg],"-by") == 0 && (iarg+1) < argc) {
  57.                 iarg++;
  58.                 by_passed = true;
  59.                 by = argv[iarg];
  60.             } else if (strcmp(argv[iarg],"-only") == 0 && (iarg+1) < argc) {
  61.                 iarg++;
  62.                 only_passed = true;
  63.                 only = argv[iarg];
  64.             } else {
  65.                 cerr << "Bad option: " << argv[iarg] << "\n";
  66.                 Usage(); exit(1);
  67.             }
  68.         }
  69.         if (!infile_passed) {
  70.             cerr << "Missing parameter: infile\n";
  71.                 Usage(); exit(1);
  72.         }
  73. }
  74.