globjects  2.0.0.4363356ae2ef
Strict OpenGL objects wrapper.
Loading...
Searching...
No Matches

String source associated to a file. More...

#include <globjects/include/globjects/base/File.h>

Inheritance diagram for globjects::File:
globjects::AbstractStringSource globjects::Instantiator< File >

Public Member Functions

 File (const std::string &filePath, bool binary=true)
 
virtual ~File ()
 
virtual std::string string () const override
 
virtual std::string shortInfo () const override
 
const std::string & filePath () const
 
void reload ()
 
- Public Member Functions inherited from globjects::AbstractStringSource
 AbstractStringSource ()
 
virtual ~AbstractStringSource ()
 
virtual std::string string () const =0
 
virtual std::vector< std::string > strings () const
 
std::vector< const AbstractStringSource * > flatten () const
 
virtual void flattenInto (std::vector< const AbstractStringSource * > &vector) const
 
virtual std::string shortInfo () const
 
void changed () const
 
void registerListener (AbstractStringSource *listener)
 
void deregisterListener (AbstractStringSource *listener)
 
void registerListener (Shader *listener)
 
void deregisterListener (Shader *listener)
 
void registerListener (NamedString *listener)
 
void deregisterListener (NamedString *listener)
 
void addSubject (AbstractStringSource *subject)
 
void removeSubject (AbstractStringSource *subject)
 

Protected Member Functions

void loadFileContent () const
 
- Protected Member Functions inherited from globjects::AbstractStringSource
virtual void notifyChanged (const AbstractStringSource *sender)
 

Protected Attributes

std::string m_filePath
 
bool m_binary
 
std::string m_source
 
bool m_valid
 
- Protected Attributes inherited from globjects::AbstractStringSource
std::set< AbstractStringSource * > m_sourceListener
 
std::set< Shader * > m_shaderListener
 
std::set< NamedString * > m_namedStringListener
 
std::set< AbstractStringSource * > m_subjects
 

Additional Inherited Members

- Static Public Member Functions inherited from globjects::Instantiator< File >
static std::unique_ptr< Filecreate (Args &&... args)
 
static std::unique_ptr< FilefromId (gl::GLuint id, Args &&... args)
 

Detailed Description

String source associated to a file.

The file path of a File can be queried using filePath(); To reload the contents from a file, use reload().

See also
StringSource

Constructor & Destructor Documentation

◆ File()

globjects::File::File ( const std::string &  filePath,
bool  binary = true 
)

◆ ~File()

virtual globjects::File::~File ( )
virtual

Member Function Documentation

◆ string()

virtual std::string globjects::File::string ( ) const
overridevirtual

◆ shortInfo()

virtual std::string globjects::File::shortInfo ( ) const
overridevirtual

Reimplemented from globjects::AbstractStringSource.

◆ filePath()

const std::string & globjects::File::filePath ( ) const

◆ reload()

void globjects::File::reload ( )

◆ loadFileContent()

void globjects::File::loadFileContent ( ) const
protected

Member Data Documentation

◆ m_filePath

std::string globjects::File::m_filePath
protected

◆ m_binary

bool globjects::File::m_binary
protected

◆ m_source

std::string globjects::File::m_source
mutableprotected

◆ m_valid

bool globjects::File::m_valid
mutableprotected

The documentation for this class was generated from the following file: