00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00025 #ifndef MAKEFILE_H_
00026 #define MAKEFILE_H_
00027
00028 #include "char_type.h"
00029 #include <vector>
00030 #include <iostream>
00031 #include <stdexcept>
00032 #include <locale>
00033
00034 #include <hugin_shared.h>
00035
00039 namespace makefile
00040 {
00041 class MakefileItem;
00046 class MAKEIMPEX Makefile
00047 {
00049 std::vector<MakefileItem*> items;
00051 bool written;
00052 Makefile() : written(false) {}
00053 static Makefile* instance;
00054 public:
00055 virtual ~Makefile() {}
00056 static Makefile& getSingleton();
00057 static void clean();
00058
00064 static const std::locale locale;
00065
00069 enum QuoteMode {MAKE, SHELL, NONE};
00070 static string quote(const string& in, Makefile::QuoteMode mode);
00071 #ifdef WIN32
00072
00073 static string quoteEnvironment(const string& in);
00074 #endif
00075
00082 void add(MakefileItem* item)
00083 {
00084 items.push_back(item);
00085 }
00086
00099 static void remove(MakefileItem* item);
00100
00106 int writeMakefile(ostream& out);
00107 };
00108
00109 MAKEIMPEX const std::locale GetMakefileLocale();
00110
00111 }
00112
00113 #endif