3 This file is part of libmspdatafile
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef TOOL_COMPILER_H_
9 #define TOOL_COMPILER_H_
11 #include <msp/datafile/loader.h>
12 #include <msp/datafile/statement.h>
13 #include <msp/datafile/writer.h>
14 #include <msp/fs/path.h>
16 class Compiler: public Msp::DataFile::Loader
22 Msp::DataFile::Writer &writer;
26 Compiler(Msp::DataFile::Writer &);
28 void file(const std::string &);
29 void for_each(const std::vector<std::string> &);
30 void write(const Msp::DataFile::Statement &);
32 bool process_statement(const Msp::FS::Path &, Msp::DataFile::Statement &);
33 void process_file(const Msp::FS::Path &, const std::list<Msp::DataFile::Statement> &);
34 void process_file(const Msp::FS::Path &);
38 class File: public Msp::DataFile::Loader
42 Msp::FS::Path filename;
43 std::list<Msp::DataFile::Statement> write_st;
46 File(Compiler &, const Msp::FS::Path &);
48 virtual void finish();
50 void write(const Msp::DataFile::Statement &);
54 class ForEach: public Msp::DataFile::Loader
59 std::list<std::string> patterns;
60 std::list<std::string> excludes;
61 std::list<Msp::DataFile::Statement> write_st;
64 ForEach(Compiler &, const Msp::FS::Path &, const std::list<std::string> &);
66 virtual void finish();
68 void exclude(const std::string &);
69 void pattern(const std::string &);
70 void write(const Msp::DataFile::Statement &);