Loading...
Searching...
No Matches
StringTemplate.h
Go to the documentation of this file.
#pragma once
#include <string>
#include <map>
#include <globjects/globjects_api.h>
#include <globjects/base/StringSourceDecorator.h>
namespace globjects
{
class GLOBJECTS_API StringTemplate : public StringSourceDecorator
{
public:
StringTemplate(AbstractStringSource * source);
virtual std::string string() const override;
virtual void update() override;
void replace(const std::string & original, const std::string & str);
void replace(const std::string & original, int i);
void clearReplacements();
protected:
mutable std::string m_modifiedSource;
mutable bool m_modifiedSourceValid;
std::map<std::string, std::string> m_replacements;
virtual ~StringTemplate();
void invalidate();
std::string modifiedSource() const;
};
} // namespace globjects
StringSourceDecorator.h
globjects::AbstractStringSource
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition AbstractStringSource.h:26
globjects::StringSourceDecorator
Definition StringSourceDecorator.h:16
globjects::StringTemplate
Definition StringTemplate.h:17
globjects::StringTemplate::replace
void replace(const std::string &original, int i)
globjects::StringTemplate::m_replacements
std::map< std::string, std::string > m_replacements
Definition StringTemplate.h:33
globjects::StringTemplate::m_modifiedSourceValid
bool m_modifiedSourceValid
Definition StringTemplate.h:31
globjects::StringTemplate::clearReplacements
void clearReplacements()
globjects::StringTemplate::invalidate
void invalidate()
globjects::StringTemplate::string
virtual std::string string() const override
globjects::StringTemplate::modifiedSource
std::string modifiedSource() const
globjects::StringTemplate::StringTemplate
StringTemplate(AbstractStringSource *source)
globjects::StringTemplate::m_modifiedSource
std::string m_modifiedSource
Definition StringTemplate.h:30
globjects::StringTemplate::replace
void replace(const std::string &original, const std::string &str)
globjects::StringTemplate::~StringTemplate
virtual ~StringTemplate()
globjects::StringTemplate::update
virtual void update() override
globjects
Contains all the classes that wrap OpenGL functionality.