Listing 4: CommandLine class’s public interface

#ifndef ATD_TOOLS_COMMANDLINE_H
#define ATD_TOOLS_COMMANDLINE_H

#include <string>
#include <map>
#include <sstream>

namespace tools
{
  class CommandLine
  {
  public:
    CommandLine(int argc, char* argv[]) throw (std::string);
    CommandLine(int argc, char* argv[],
                const std::string& strFileName)
    CommandLine(const std::string& strFileName) throw (std::string);
    virtual ~CommandLine();
    std::string GetByName( const std::string& strArgName ) const
                 throw (std::string);
    inline bool Exists( const std::string& strArgName ) const;
    inline int Count() const;
    virtual std::string Usage();
    void DumpDiagnostics() const;
    inline std::string GetProgramName() const;
  private:
    // Private data and methods omitted to save space
  };
} //end of tools namespace
#include "CommandLine.icc"
#endif // #ifndef ATD_TOOLS_COMMANDLINE_H

— End of Listing —