You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ra...@locus.apache.org on 2000/06/20 04:23:13 UTC

cvs commit: xml-xerces/c/samples/StdInParse StdInParse.cpp

rahulj      00/06/19 19:23:12

  Modified:    c/samples/PParse PParse.cpp
               c/samples/StdInParse StdInParse.cpp
  Log:
  Help message added by Joe Polastre.
  
  Revision  Changes    Path
  1.7       +17 -11    xml-xerces/c/samples/PParse/PParse.cpp
  
  Index: PParse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/PParse/PParse.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PParse.cpp	2000/03/03 01:29:31	1.6
  +++ PParse.cpp	2000/06/20 02:23:08	1.7
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: PParse.cpp,v $
  + * Revision 1.7  2000/06/20 02:23:08  rahulj
  + * Help message added by Joe Polastre.
  + *
    * Revision 1.6  2000/03/03 01:29:31  roddey
    * Added a scanReset()/parseReset() method to the scanner and
    * parsers, to allow for reset after early exit from a progressive parse.
  @@ -119,10 +122,6 @@
   //  xmlFile
   //      The path to the file to parser. Set via command line.
   //
  -//  doEscapes
  -//      Indicates whether special chars should be escaped in the output.
  -//      Defaults to doing escapes, -NoEscape overrides.
  -//
   //  doNamespaces
   //      Indicates whether namespace processing should be done.
   //
  @@ -131,7 +130,6 @@
   //      to validate, but -v overrides that.
   // ---------------------------------------------------------------------------
   static char*	xmlFile         = 0;
  -static bool     doEscapes       = true;
   static bool     doNamespaces    = false;
   static bool     doValidation    = false;
   
  @@ -142,8 +140,17 @@
   // ---------------------------------------------------------------------------
   static void usage()
   {
  -    cout <<  "\nUsage: PParse file\n"
  -         <<  "   This program demonstrates progressive parsing\n"
  +    cout <<  "\nUsage: PParse [options] <file>\n\n"
  +         <<  "This sample program demonstrates the progressive parse capabilities of\n"
  +	     <<  "the parser system. It allows you to do a scanFirst() call followed by\n"
  +         <<  "a loop which calls scanNext(). You can drop out when you've found what\n"
  +         <<  "ever it is you want. In our little test, our event handler looks for\n"
  +         <<  "16 new elements then sets a flag to indicate its found what it wants.\n"
  +         <<  "At that point, our progressive parse loop exits.\n\n"
  +         <<  "Options:\n"
  +         <<  "      -v            - Do validation [default is off]\n"
  +         <<  "      -n            - Enable namespace processing [default is off]\n"
  +         <<  "      -?            - Show this help (must be the only parameter)\n"
            <<  endl;
   }
   
  @@ -199,10 +206,6 @@
                 ||  !strcmp(argV[parmInd], "-N"))
           {
               doNamespaces = true;
  -        }
  -         else if (!strcmp(argV[parmInd], "-NoEscape"))
  -        {
  -            doEscapes = false;
           }
            else
           {
  
  
  
  1.6       +13 -2     xml-xerces/c/samples/StdInParse/StdInParse.cpp
  
  Index: StdInParse.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/StdInParse/StdInParse.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StdInParse.cpp	2000/03/02 19:53:50	1.5
  +++ StdInParse.cpp	2000/06/20 02:23:10	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: StdInParse.cpp,v $
  + * Revision 1.6  2000/06/20 02:23:10  rahulj
  + * Help message added by Joe Polastre.
  + *
    * Revision 1.5  2000/03/02 19:53:50  roddey
    * This checkin includes many changes done while waiting for the
    * 1.1.0 code to be finished. I can't list them all here, but a list is
  @@ -110,8 +113,9 @@
   {
       cout << "\nUsage:\n"
            << "    StdInParse [options]\n"
  -         << "    -v  Do a validating parse. Defaults to non-validating.\n"
  -         << "    -n  Enable namespace processing.\n\n"
  +         << "    -v  Do a validating parse. [default is off]\n"
  +         << "    -n  Enable namespace processing. [default is off]\n"
  +		 << "    -?  Show this help\n\n"
            << "This program allows you to redirect a file into the program\n"
            << "to be parsed. It will count the elements, characters, and \n"
            << "spaces and display these stats at the end\n"
  @@ -140,6 +144,11 @@
       int parmInd;
       for (parmInd = 1; parmInd < argC; parmInd++)
       {
  +		if (!strcmp(argV[parmInd], "-?"))
  +		{
  +			usage();
  +			return 1;
  +		}
           if (!strcmp(argV[parmInd], "-v")
           ||  !strcmp(argV[parmInd], "-V"))
           {