]> git.tdb.fi Git - libs/datafile.git/blobdiff - tool/builtingenerator.h
Add support for generating .cpp files for BuiltinSource
[libs/datafile.git] / tool / builtingenerator.h
diff --git a/tool/builtingenerator.h b/tool/builtingenerator.h
new file mode 100644 (file)
index 0000000..d6a0886
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef TOOL_BUILTINGENERATOR_H_
+#define TOOL_BUILTINGENERATOR_H_
+
+#include <string>
+#include <vector>
+#include <msp/io/file.h>
+
+class BuiltinGenerator
+{
+private:
+       Msp::IO::Base &out;
+       std::vector<std::string> namespc;
+       std::vector<std::string> filenames;
+
+public:
+       BuiltinGenerator(Msp::IO::Base &);
+
+       void begin(const std::string &);
+       void add_file(const std::string &);
+       void end(const std::string &);
+
+private:
+       static std::string mangle_filename(const std::string &);
+};
+
+#endif