| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

StringTemplate.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <string>
5 #include <map>
6
7 #include <globjects/globjects_api.h>
8
9 #include <globjects/base/StringSourceDecorator.h>
10
11
12 namespace globjects
13 {
14
15
16 class GLOBJECTS_API StringTemplate : public StringSourceDecorator
17 {
18 public:
19 StringTemplate(AbstractStringSource * source);
20
21 virtual std::string string() const override;
22 virtual void update() override;
23
24 void replace(const std::string & original, const std::string & str);
25 void replace(const std::string & original, int i);
26
27 void clearReplacements();
28
29 protected:
30 mutable std::string m_modifiedSource;
31 mutable bool m_modifiedSourceValid;
32
33 std::map<std::string, std::string> m_replacements;
34
35 virtual ~StringTemplate();
36
37 void invalidate();
38 std::string modifiedSource() const;
39 };
40
41
42 } // namespace globjects
globjects::StringSourceDecorator
Definition: StringSourceDecorator.h:15
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::StringTemplate::m_replacements
std::map< std::string, std::string > m_replacements
Definition: StringTemplate.h:33
globjects::StringTemplate
Definition: StringTemplate.h:16
globjects::StringTemplate::m_modifiedSource
std::string m_modifiedSource
Definition: StringTemplate.h:30
StringSourceDecorator.h
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code...
Definition: AbstractStringSource.h:25
globjects::StringTemplate::m_modifiedSourceValid
bool m_modifiedSourceValid
Definition: StringTemplate.h:31