(file) Return to OptionManager.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common / Attic

Diff for /pegasus/src/Pegasus/Common/Attic/OptionManager.h between version 1.46 and 1.47

version 1.46, 2006/06/19 19:37:29 version 1.47, 2006/11/10 18:14:58
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By: Karl Schopmyer(k.schopmeyer@opengroup.org)  
 //              David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 ////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
Line 207 
Line 201 
     The option manager allows for several types of options including:     The option manager allows for several types of options including:
     <UL>     <UL>
         <LI> (BOOLEAN)Simple keyword parameters (ex. -t or -h on the command         <LI> (BOOLEAN)Simple keyword parameters (ex. -t or -h on the command
         line). These are Boolean parameters and there are no additional parameters          line). These are Boolean parameters and there are no additional
         after the keyword.          parameters after the keyword.
  
         <LI> (INTEGER) Numeric parameters - (ex -port 5988). These are         <LI> (INTEGER) Numeric parameters - (ex -port 5988). These are
         parameters where a numeric variable follows the parameter defintion.         parameters where a numeric variable follows the parameter defintion.
Line 223 
Line 217 
         be resolvable to a single string.         be resolvable to a single string.
  
         <LI> (STRING) Domain Parameters - These are parameters where there is         <LI> (STRING) Domain Parameters - These are parameters where there is
         a choice of keywords from a domain of keywords. The input parameter may be any          a choice of keywords from a domain of keywords.  The input parameter
         one of these keywords. Thus, the domain (red blue green) for the          may be any one of these keywords. Thus, the domain (red blue green)
         parameter "color" (-c) could be entered as -c red. The difference          for the parameter "color" (-c) could be entered as -c red. The
         between String interpretation and domain interpretation is the use of the          difference between String interpretation and domain interpretation
         domain fields in the option definition.          is the use of the domain fields in the option definition.
  
         <LI> Mask parameters - These are parameters that define an internal         <LI> Mask parameters - These are parameters that define an internal
         bit mask from a set of keywords input.         bit mask from a set of keywords input.
Line 273 
Line 267 
         must have the form -option. If they are present, then they are         must have the form -option. If they are present, then they are
         taken to be true.         taken to be true.
  
         &param argc number of argument on the command line.          @param argc number of argument on the command line.
         &param argv list of command line arguments.          @param argv list of command line arguments.
         &param abortOnErr - Optional Boolean that if true causes exception if there is          @param abortOnErr - Optional Boolean that if true causes exception
         a parameter found that is not in the table. Defaults to true          if there is a parameter found that is not in the table. Defaults to
         &exception InvalidOptionValue if validation fails.          true
         &exception OMMissingCommandLineOptionArgument          @exception InvalidOptionValue if validation fails.
           @exception OMMissingCommandLineOptionArgument
     */     */
     void mergeCommandLine(int& argc, char**& argv, Boolean abortOnErr=true);     void mergeCommandLine(int& argc, char**& argv, Boolean abortOnErr=true);
  
Line 288 
Line 283 
         Option::isValid(). Valid option values are set by calling         Option::isValid(). Valid option values are set by calling
         Option::setValue().         Option::setValue().
  
         &param fileName name of file to be merged.          @param fileName name of file to be merged.
         &exception NoSuchFile if file cannot be opened.          @exception NoSuchFile if file cannot be opened.
         &exception BadConfigFileOption          @exception BadConfigFileOption
     */     */
     void mergeFile(const String& fileName);     void mergeFile(const String& fileName);
  
     /** After merging, this method is called to check for required options     /** After merging, this method is called to check for required options
         that were not merged (specified).         that were not merged (specified).
  
         &exception OMMissingRequiredRequiredOption          @exception OMMissingRequiredRequiredOption
     */     */
     void checkRequiredOptions() const;     void checkRequiredOptions() const;
  
Line 359 
Line 354 
     */     */
     void printOptionsHelp() const;     void printOptionsHelp() const;
  
     /** Print Complete Help Text message including header before the options help      /** Print Complete Help Text message including header before the options
         and trailer after the options help          help and trailer after the options help
     */     */
     void printOptionsHelpTxt(const String& header, const String& trailer) const;     void printOptionsHelpTxt(const String& header, const String& trailer) const;
  
Line 618 
Line 613 
 */ */
  
 /** Exception class */ /** Exception class */
 class PEGASUS_COMMON_LINKAGE OMMissingCommandLineOptionArgument : public Exception  class PEGASUS_COMMON_LINKAGE OMMissingCommandLineOptionArgument
       : public Exception
 { {
 public: public:
  
         //l10n  
     //OMMissingCommandLineOptionArgument(const String& optionName)  
         //: Exception("Missing command line option argument: " + optionName) { }  
         OMMissingCommandLineOptionArgument(const String& optionName)         OMMissingCommandLineOptionArgument(const String& optionName)
         : Exception(MessageLoaderParms("Common.OptionManager.MISSING_CMD_LINE_OPTION",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.MISSING_CMD_LINE_OPTION",
                                                                                          "Missing command line option argument: $0",                                                                                          "Missing command line option argument: $0",
                                                                                          optionName)) { }                optionName))
       {
       }
 }; };
  
 /** Exception class */ /** Exception class */
Line 636 
Line 632 
 { {
 public: public:
  
         //l10n  
     //OMInvalidOptionValue(const String& name, const String& value)  
         //: Exception("Invalid option value: " + name + "=\"" + value + "\"") { }  
         OMInvalidOptionValue(const String& name, const String& value)         OMInvalidOptionValue(const String& name, const String& value)
         : Exception(MessageLoaderParms("Common.OptionManager.INVALID_OPTION_VALUE",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.INVALID_OPTION_VALUE",
                                                                                          "Invalid option value: $0=\"$1\"",                                                                                          "Invalid option value: $0=\"$1\"",
                                                                                          name,                                                                                          name,
                                                                                          value)) { }                value))
       {
       }
 }; };
  
 /** Exception class */ /** Exception class */
 class PEGASUS_COMMON_LINKAGE OMDuplicateOption : public Exception class PEGASUS_COMMON_LINKAGE OMDuplicateOption : public Exception
 { {
 public: public:
 //l10n  
     //OMDuplicateOption(const String& name)  
         //: Exception("Duplicate option: " + name) { }  
         OMDuplicateOption(const String& name)         OMDuplicateOption(const String& name)
         : Exception(MessageLoaderParms("Common.OptionManager.DUPLICATE_OPTION",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.DUPLICATE_OPTION",
                                                                                          "Duplicate option: $0",                                                                                          "Duplicate option: $0",
                                                                                          name)) { }                name))
       {
       }
 }; };
  
 /** Exception class */ /** Exception class */
Line 674 
Line 670 
 class PEGASUS_COMMON_LINKAGE OMUnrecognizedConfigFileOption : public Exception class PEGASUS_COMMON_LINKAGE OMUnrecognizedConfigFileOption : public Exception
 { {
 public: public:
 //l10n  
     //OMUnrecognizedConfigFileOption(const String& name)  
         //: Exception("Unrecognized config file option: " + name) { }  
         OMUnrecognizedConfigFileOption(const String& name)         OMUnrecognizedConfigFileOption(const String& name)
         : Exception(MessageLoaderParms("Common.OptionManager.UNRECOGNIZED_CONFIG_FILE_OPTION",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.UNRECOGNIZED_CONFIG_FILE_OPTION",
                                                                                          "Unrecognized config file option: $0",                                                                                          "Unrecognized config file option: $0",
                                                                                          name)) { }                name))
       {
       }
 }; };
  
 /** Exception class */ /** Exception class */
 class PEGASUS_COMMON_LINKAGE OMMissingRequiredOptionValue : public Exception class PEGASUS_COMMON_LINKAGE OMMissingRequiredOptionValue : public Exception
 { {
 public: public:
 //l10n  
     //OMMissingRequiredOptionValue(const String& name)  
         //: Exception("Missing required option value: " + name) { }  
         OMMissingRequiredOptionValue(const String& name)         OMMissingRequiredOptionValue(const String& name)
         : Exception(MessageLoaderParms("Common.OptionManager.MISSING_REQUIRED_OPTION",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.MISSING_REQUIRED_OPTION",
                                                                                          "Missing required option value: $0",                                                                                          "Missing required option value: $0",
                                                                                          name)) { }                name))
       {
       }
 }; };
  
 /** Exception class */ /** Exception class */
 class PEGASUS_COMMON_LINKAGE OMMBadCmdLineOption : public Exception class PEGASUS_COMMON_LINKAGE OMMBadCmdLineOption : public Exception
 { {
 public: public:
 //l10n  
    // OMMBadCmdLineOption(const String& name)  
         //: Exception("Parameter not Valid: " + name) { }  
         OMMBadCmdLineOption(const String& name)         OMMBadCmdLineOption(const String& name)
         : Exception(MessageLoaderParms("Common.OptionManager.PARAMETER_NOT_VALID",          : Exception(MessageLoaderParms(
                 "Common.OptionManager.PARAMETER_NOT_VALID",
                                                                                          "Parameter not Valid: $0",                                                                                          "Parameter not Valid: $0",
                                                                                          name)) { }                name))
       {
       }
 }; };
  
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END
  
 #endif /* Pegasus_OM_h */ #endif /* Pegasus_OM_h */


Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2