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;
25 Compiler(Msp::DataFile::Writer &);
27 void file(const std::string &);
28 void for_each(const std::vector<std::string> &);
29 void write(const Msp::DataFile::Statement &);
31 bool process_statement(const Msp::FS::Path &, Msp::DataFile::Statement &);
32 void process_file(const Msp::FS::Path &, const std::list<Msp::DataFile::Statement> &);
33 void process_file(const Msp::FS::Path &);
36 class File: public Msp::DataFile::Loader
40 Msp::FS::Path filename;
41 std::list<Msp::DataFile::Statement> write_st;
44 File(Compiler &, const Msp::FS::Path &);
46 virtual void finish();
48 void write(const Msp::DataFile::Statement &);
51 class ForEach: public Msp::DataFile::Loader
56 std::list<std::string> patterns;
57 std::list<std::string> excludes;
58 std::list<Msp::DataFile::Statement> write_st;
61 ForEach(Compiler &, const Msp::FS::Path &, const std::list<std::string> &);
63 virtual void finish();
65 void exclude(const std::string &);
66 void pattern(const std::string &);
67 void write(const Msp::DataFile::Statement &);