]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/sourcemap.h
Track source names in SL::Module
[libs/gl.git] / source / glsl / sourcemap.h
diff --git a/source/glsl/sourcemap.h b/source/glsl/sourcemap.h
new file mode 100644 (file)
index 0000000..6df6418
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef MSP_GL_SL_SOURCEMAP_H_
+#define MSP_GL_SL_SOURCEMAP_H_
+
+#include <string>
+#include <vector>
+
+namespace Msp {
+namespace GL {
+namespace SL {
+
+class SourceMap
+{
+private:
+       unsigned base_index;
+       std::vector<std::string> source_names;
+
+public:
+       SourceMap();
+
+       void set_name(unsigned, const std::string &);
+       unsigned get_count() const { return base_index+source_names.size(); }
+       void merge_from(const SourceMap &);
+       std::string translate_errors(const std::string &) const;
+};
+
+} // namespace SL
+} // namespace GL
+} // namespace Msp
+
+#endif