00001 /* 00002 This descendent of matcher, performs matches against a single character. 00003 00004 Copyright (C) 2002 Ross A. Beyer 00005 00006 Contact Author: Ross A. Beyer, rbeyer@rossbeyer.net 00007 00008 CVS $Id: char_matcher.hpp,v 1.2 2003/03/03 00:52:30 rbeyer Exp $ 00009 00010 00011 License & Copyright Information 00012 ------------------------------- 00013 00014 This file is part of the commandl package, 00015 $Name: commandl_Beta-1 $. 00016 00017 The commandl packge is free software; you can redistribute it 00018 and/or modify it under the terms of the GNU General Public License 00019 as published by the Free Software Foundation; either version 2 of the 00020 License, or (at your option) any later version. 00021 00022 The commandl package is distributed in the hope that it will be useful, 00023 but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 GNU General Public License for more details. 00026 00027 You should have received a copy of the GNU General Public License 00028 along with this program; if not, write to the Free Software 00029 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00030 00031 */ 00032 00033 #ifndef CHAR_MATCHER_HEADER // Begin the Header Guard to prevent multiple 00034 #define CHAR_MATCHER_HEADER // inclusions. 00035 00036 #include "matcher.hpp" 00037 #include <map> 00038 #include <string> 00039 #include <vector> 00040 00041 namespace commandl 00042 { 00043 00049 class char_matcher : public matcher 00050 { 00051 00052 // ==================== Constructors & Destructor ===================== // 00053 public: 00054 00055 char_matcher(); 00056 00057 char_matcher 00058 ( 00059 std::vector<argument*> // arguments 00060 ); 00061 00062 virtual ~char_matcher(); 00063 00064 // =========================== Accessors ============================== // 00065 public: 00066 00067 virtual argument* 00068 match( const std::string& ) const; 00069 00070 virtual std::string 00071 usage_key( const std::string& ) const; 00072 00073 virtual std::vector<std::string> 00074 usage_keys( const std::vector<std::string>& ) const; 00075 00076 00077 // =========================== Methods ================================ // 00078 public: 00079 00080 virtual std::map<std::string, argument*> 00081 resolve_keys 00082 ( 00083 const std::vector<argument*>& 00084 ); 00085 00086 virtual char_matcher* 00087 clone() const; 00088 00089 // --------------------------- Protected Methods ---------------------- // 00090 protected: 00091 00092 00093 // --------------------------- Private Methods ------------------------ // 00094 private: 00095 00096 00097 // =========================== Member Variables ======================= // 00098 protected: 00099 00100 00101 }; // End of the class declaration 00102 00103 } // End of the namespace declaration 00104 00105 #endif // End the Header Guard 00106