globjects  2.0.0.4363356ae2ef
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches
File.h
Go to the documentation of this file.
1
2#pragma once
3
4
5#include <string>
6
7#include <globjects/globjects_api.h>
8
11
12
13namespace globjects
14{
15
16
24class GLOBJECTS_API File : public globjects::AbstractStringSource, public Instantiator<File>
25{
26public:
27 File(const std::string & filePath, bool binary = true);
28
29 virtual ~File();
30
31 virtual std::string string() const override;
32 virtual std::string shortInfo() const override;
33
34 const std::string & filePath() const;
35
36 void reload();
37
38protected:
39 std::string m_filePath;
41 mutable std::string m_source;
42 mutable bool m_valid;
43
44 void loadFileContent() const;
45};
46
47
48} // namespace globjects
Superclass for all types of static and dynamic strings, e.g. for the use as Shader code.
Definition: AbstractStringSource.h:27
String source associated to a file.
Definition: File.h:25
virtual ~File()
File(const std::string &filePath, bool binary=true)
void loadFileContent() const
virtual std::string string() const override
std::string m_source
Definition: File.h:41
virtual std::string shortInfo() const override
const std::string & filePath() const
bool m_binary
Definition: File.h:40
bool m_valid
Definition: File.h:42
std::string m_filePath
Definition: File.h:39
CRTP for creating objects similar to std::make_unique.
Definition: Instantiator.h:22
Contains all the classes that wrap OpenGL functionality.