00001 /* 00002 This is a descendent of argument that deals with float values. 00003 00004 Copyright (C) 2002 Ross A. Beyer 00005 00006 Contact Author: Ross A. Beyer, rbeyer@rossbeyer.net 00007 00008 CVS $Id: float_arg.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 FLOAT_ARG_HEADER // Begin the Header Guard to prevent multiple 00034 #define FLOAT_ARG_HEADER // inclusions. 00035 00036 #include "argument.hpp" 00037 00038 namespace commandl 00039 { 00040 00044 class float_arg : public argument 00045 { 00046 00047 // ==================== Constructors & Destructor ===================== // 00048 public: 00049 00050 float_arg 00051 ( 00052 std::vector<std::string>, // keys 00053 std::string = "", // value description 00054 std::string = "", // description 00055 bool = false, // argument required 00056 bool = false // value required? 00057 ); 00058 00059 float_arg 00060 ( 00061 std::string, // key 00062 std::string = "", // value description 00063 std::string = "", // description 00064 bool = false, // argument required 00065 bool = false // value required? 00066 ); 00067 00068 00069 // =========================== Accessors ============================== // 00070 public: 00071 00072 operator float() const; 00073 00074 00075 // =========================== Methods ================================ // 00076 public: 00077 00078 // value(s) prefix, key, assignment 00079 void operator() ( 00080 const std::string&, // prefix 00081 const std::string&, // key 00082 const unsigned long // order 00083 ); 00084 void operator() ( 00085 const std::string&, // value 00086 const std::string&, // prefix 00087 const std::string&, // key 00088 const std::string&, // assign 00089 const unsigned long // order 00090 ); 00091 void operator() ( 00092 const std::vector<std::string>&, // values 00093 const std::string&, // prefix 00094 const std::string&, // key 00095 const std::string&, // assign 00096 const unsigned long // order 00097 ); 00098 float_arg& operator=( const float& ); 00099 00100 00101 // --------------------------- Protected Methods ---------------------- // 00102 protected: 00103 00104 00105 // --------------------------- Private Methods ------------------------ // 00106 private: 00107 00108 00109 // =========================== Member Variables ======================= // 00110 protected: 00111 00113 float arguments_float; 00114 00115 00116 }; // End of the class declaration 00117 00118 } // End of the namespace declaration 00119 00120 #endif // End the Header Guard 00121