00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 2007, 2008 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 3 of the License, or 00008 // (at 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 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_SUB_FUNCTOR_VARIABLE_H 00021 #define LIBAEGIS_SUB_FUNCTOR_VARIABLE_H 00022 00023 #include <libaegis/sub/functor.h> 00024 00029 class sub_functor_variable: 00030 public sub_functor 00031 { 00032 public: 00036 virtual ~sub_functor_variable(); 00037 00038 private: 00048 sub_functor_variable(const nstring &name, const nstring &value); 00049 00050 public: 00063 static pointer create(const nstring &name, const nstring &value); 00064 00065 protected: 00066 // See base class for documentation 00067 wstring evaluate(sub_context_ty *, const wstring_list &); 00068 00069 // See base class for documentation 00070 bool append_if_unused() const; 00071 00072 // See base class for documentation 00073 bool override() const; 00074 00075 // See base class for documentation 00076 bool resubstitute() const; 00077 00078 // See base class for documentation 00079 bool must_be_used() const; 00080 00081 // See base class for documentation 00082 void resubstitute_set(); 00083 00084 // See base class for documentation 00085 void override_set(); 00086 00087 // See base class for documentation 00088 void optional_set(); 00089 00090 // See base class for documentation 00091 void append_if_unused_set(); 00092 00093 private: 00098 wstring value; 00099 00104 bool used; 00105 00111 bool append_if_unused_flag; 00112 00118 bool override_flag; 00119 00125 bool resubstitute_flag; 00126 00130 sub_functor_variable(); 00131 00135 sub_functor_variable(const sub_functor_variable &); 00136 00140 sub_functor_variable &operator=(const sub_functor_variable &); 00141 }; 00142 00143 #endif // LIBAEGIS_SUB_FUNCTOR_VARIABLE_H