Variable.h

Go to the documentation of this file.
00001 /*
00002 This file is part of hugin.
00003 
00004 hugin is free software: you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation, either version 2 of the License, or
00007 (at your option) any later version.
00008 
00009 hugin is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with hugin.  If not, see <http://www.gnu.org/licenses/>.
00016 */
00017 
00025 #ifndef VARIABLE_H_
00026 #define VARIABLE_H_
00027 
00028 #include "VariableDef.h"
00029 #include "VariableRef.h"
00030 #include "Makefile.h"
00031 #include "Manageable.h"
00032 #include <vector>
00033 
00034 namespace makefile
00035 {
00036 
00042 class MAKEIMPEX Variable : public Manageable
00043 {
00044 protected:
00045         string name;
00047         std::vector<string> values;
00049         string separator;
00051         VariableDef* def;
00053         VariableRef* ref;
00054         Makefile::QuoteMode quotemode;
00056         bool exported;
00057 
00061         virtual void checkName();
00065         virtual void checkValue();
00066 
00067     void Create();
00068 
00070         Variable(string name_);
00071 
00072 private:
00073         Variable(const Variable&);      // no implicite copies!
00074 public:
00076         Variable(string name_, string value_, Makefile::QuoteMode quotemode_ = Makefile::SHELL);
00078         Variable(string name_, double value_, Makefile::QuoteMode quotemode_ = Makefile::NONE);
00083         Variable(string name_,std::vector<string>::iterator start, std::vector<string>::iterator end,
00084                         Makefile::QuoteMode quotemode_ = Makefile::SHELL, string separator_ = " ");
00085 
00086         virtual ~Variable();
00087 
00088         virtual const string getName()
00089         {
00090                 return name;
00091         }
00095         virtual const string getValue();
00099         virtual const string getquotedValue();
00100 
00104         virtual const std::vector<string>& getValues()
00105         {
00106                 return values;
00107         }
00108 
00109         virtual VariableDef& getDef()
00110         {
00111                 return *def;
00112         }
00113 
00114         virtual VariableRef& getRef()
00115         {
00116                 return *ref;
00117         }
00118 
00119         void setQuoteMode(Makefile::QuoteMode mode)
00120         {
00121                 quotemode = mode;
00122         }
00123 
00124         void setExport(bool ex)
00125         {
00126                 exported = ex;
00127         }
00128         bool getExport()
00129         {
00130                 return exported;
00131         }
00132 
00133 };
00134 
00135 }
00136 
00137 #endif /* VARIABLE_H_ */

Generated on Wed Jul 30 01:25:44 2014 for Hugintrunk by  doxygen 1.3.9.1