nis-util
1.0.D108
|
00001 // 00002 // nis-util - NIS Administration Utilities 00003 // Copyright (C) 2012 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 2 of the License, or (at 00008 // your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License along 00016 // with this program. If not, see <http://www.gnu.org/licenses/>. 00017 // 00018 00019 #ifndef LIB_CONFIGURATION_ITEM_INTEGER_H 00020 #define LIB_CONFIGURATION_ITEM_INTEGER_H 00021 00022 #include <lib/configuration/item.h> 00023 00028 class configuration_item_integer: 00029 public configuration_item 00030 { 00031 public: 00035 virtual ~configuration_item_integer(); 00036 00049 static bool candidate(const rcstring &text, long &value); 00050 00068 static pointer create_if_candidate(const source_location &locn, 00069 level_t level, const rcstring &name, const rcstring &potential_value); 00070 00086 static pointer create(const source_location &locn, level_t level, 00087 const rcstring &name, long value); 00088 00089 protected: 00090 // See base class for documentation. 00091 rcstring get_string_value(void) const; 00092 00093 // See base class for documentation. 00094 bool get_bool_value(void) const; 00095 00096 // See base class for documentation. 00097 long get_long_value(void) const; 00098 00099 private: 00113 configuration_item_integer(const source_location &locn, level_t level, 00114 const rcstring &name, long value); 00115 00120 long value; 00121 00126 configuration_item_integer(); 00127 00135 configuration_item_integer(const configuration_item_integer &rhs); 00136 00144 configuration_item_integer &operator=( 00145 const configuration_item_integer &rhs); 00146 }; 00147 00148 // vim: set ts=8 sw=4 et : 00149 #endif // LIB_CONFIGURATION_ITEM_INTEGER_H