Changeset 1060 for trunk/bin/Parameter.h


Ignore:
Timestamp:
Jun 2, 2010, 3:56:35 AM (11 years ago)
Author:
Peter Johansson
Message:

refs #307

Splittin the Parameter class into two separate classes and a base
class holding the common parts. The output of '--help' is not sorted
as before otherwise everything should be the same. The sort will
require some ammendment in yat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bin/Parameter.h

    r1023 r1060  
    4747  class Parameter {
    4848  public:
    49     Parameter( int argc, char *argv[]);
     49    Parameter(void);
    5050    virtual ~Parameter(void);
    51     const yat::utility::OptionArg<std::string>& anchor_format(void) const;
     51    void parse( int argc, char *argv[]);
     52
    5253    std::string config_file(void) const;
    5354   
    54     bool copyright(void) const;
    5555    bool force(void) const;
    5656    bool generate_config(void) const ;
    5757    bool ignore_cache(void) const;
    58     const yat::utility::OptionArg<std::string>& format(void) const;
    59     bool report(void) const;
    60     bool revisions(void) const;
    6158    /// @return absolute path to root directory
    6259    std::string root(void) const;
    63     /// @return absolute path to target directory
    64     std::string targetdir(void) const;
    6560    bool verbose(void) const;
    6661
    67   private:
    68     void analyse(void);
     62  protected:
     63    yat::utility::CommandLine cmd_;
     64    yat::utility::OptionHelp help_;
     65
    6966    // throw cmd_error if path doesn't exist
    7067    void check_existence(std::string path) const;
     
    7471    void check_readable(std::string path) const;
    7572
     73  private:
     74    void analyse(void);
     75    virtual void analyse2(void)=0;
    7676    void init(void);
     77    // called at end of init(void)
     78    virtual void init2(void) = 0;
     79    void set_default(void);
     80    virtual void set_default2(void)=0;
    7781
    78     yat::utility::CommandLine cmd_;
    79     yat::utility::OptionArg<std::string> anchor_format_;
    8082    yat::utility::OptionArg<std::string> config_file_;
    81     yat::utility::OptionSwitch copyright_;
    8283    yat::utility::OptionSwitch force_;
    8384    yat::utility::OptionSwitch generate_config_;
    84     yat::utility::OptionHelp help_;
    8585    yat::utility::OptionSwitch ignore_cache_;
    86     yat::utility::OptionArg<std::string> format_;
    87     yat::utility::OptionSwitch report_;
    88     yat::utility::OptionSwitch revisions_;
    8986    yat::utility::OptionArg<std::string> root_;
    90     yat::utility::OptionArg<std::string> target_;
    9187    yat::utility::OptionSwitch verbose_;
     88  protected:
    9289    OptionVersion version_;
    9390
Note: See TracChangeset for help on using the changeset viewer.