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 
10 
11 
12 namespace globjects
13 {
14 
15 
16 class GLOBJECTS_API StringTemplate : public StringSourceDecorator
17 {
18 public:
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
std::map< std::string, std::string > m_replacements
Definition: StringTemplate.h:33
Definition: StringSourceDecorator.h:15
std::string m_modifiedSource
Definition: StringTemplate.h:30
Contains all the classes that wrap OpenGL functionality.
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition: AbstractStringSource.h:25
Definition: StringTemplate.h:16
bool m_modifiedSourceValid
Definition: StringTemplate.h:31