Test to see if auto_props and label_mapper files are readable.
[vss2svn.git] / ssphys / SSPhys / Command.h
blob45fc4626e8af5783d23a40a542a420e850b1fe30
1 // Command.h: interface for the CCommand class.
2 //
3 //////////////////////////////////////////////////////////////////////
5 #if !defined(AFX_COMMAND_H__A42CF41F_0E40_40BA_A36B_CAAEC8A6D34E__INCLUDED_)
6 #define AFX_COMMAND_H__A42CF41F_0E40_40BA_A36B_CAAEC8A6D34E__INCLUDED_
8 #if _MSC_VER > 1000
9 #pragma once
10 #endif // _MSC_VER > 1000
12 #include "Options.h"
13 #include "Arguments.h"
14 #include "CommandLine.h"
15 #include "Formatter.h"
17 //---------------------------------------------------------------------------
18 class CCommand
20 protected:
21 CCommand (std::string commandName, std::string description);
23 public:
24 virtual ~CCommand ();
26 std::string GetCommandName () const { return m_CommandName; }
27 std::string GetCommandDescription () const { return m_CommandDescription; }
29 virtual po::options_description GetOptionsDescription () const;
30 virtual po::options_description GetHiddenDescription () const;
31 virtual po::positional_options_description GetPositionalOptionsDescription () const;
33 int Execute (std::vector <std::string> const& args);
34 virtual void Execute (po::variables_map const & options, std::vector<po::option> const & args) = 0;
36 void PrintUsage () const;
37 protected:
38 std::string m_CommandName;
39 std::string m_CommandDescription;
40 po::variables_map m_VariablesMap;
41 // po::options_description m_OptionsDescription;
42 // po::options_description m_HiddenDescription;
44 std::auto_ptr<CFormatter>& GetFormatter ();
45 private:
46 std::auto_ptr<CFormatter> m_pFormatter;
49 //---------------------------------------------------------------------------
50 class CMultiArgCommand : public CCommand
52 public:
53 CMultiArgCommand (std::string commandName, std::string description);
55 virtual po::positional_options_description GetPositionalOptionsDescription () const;
56 virtual po::options_description GetHiddenDescription () const;
58 virtual void Execute (po::variables_map const& options, std::vector<po::option> const& args);
59 virtual void Execute (po::variables_map const& options, std::string const& arg) = 0;
61 protected:
66 #endif // !defined(AFX_COMMAND_H__A42CF41F_0E40_40BA_A36B_CAAEC8A6D34E__INCLUDED_)