MAGE  v0.171.0
Matthias Advanced Game Engine
mage::loader::VARWriter Class Reference

#include <var_writer.hpp>

Inheritance diagram for mage::loader::VARWriter:
mage::Writer

Public Member Functions

 VARWriter (const ValueMap &variable_buffer)
 
 VARWriter (const VARWriter &writer)=delete
 
 VARWriter (VARWriter &&writer) noexcept
 
 ~VARWriter ()
 
VARWriteroperator= (const VARWriter &writer)=delete
 
VARWriteroperator= (VARWriter &&writer)=delete
 
void WriteToFile (std::filesystem::path path)
 
const std::filesystem::path & GetPath () const noexcept
 

Private Member Functions

virtual void Write () override
 
- Private Member Functions inherited from mage::Writer
Writeroperator= (const Writer &writer)=delete
 
Writeroperator= (Writer &&writer) noexcept
 
void WriteToFile (std::filesystem::path path)
 
 Writer ()
 
 Writer (const Writer &writer)=delete
 
 Writer (Writer &&writer) noexcept
 
 ~Writer ()
 
const std::filesystem::path & GetPath () const noexcept
 
void WriteCharacter (char c)
 
void WriteString (NotNull< const_zstring > str)
 
void WriteStringLine (NotNull< const_zstring > str)
 

Private Attributes

const ValueMapm_variable_buffer
 

Detailed Description

A class of VAR file writers for writing variable scripts.

Constructor & Destructor Documentation

◆ VARWriter() [1/3]

mage::loader::VARWriter::VARWriter ( const ValueMap variable_buffer)
explicit

Constructs a writer.

Parameters
[in]variable_bufferA reference to a map containing the variables to write to file.

◆ VARWriter() [2/3]

mage::loader::VARWriter::VARWriter ( const VARWriter writer)
delete

Constructs a VAR writer from the given VAR writer.

Parameters
[in]writerA reference to the VAR writer to copy.

◆ VARWriter() [3/3]

mage::loader::VARWriter::VARWriter ( VARWriter &&  writer)
defaultnoexcept

Constructs a VAR writer by moving the given VAR writer.

Parameters
[in]writerA reference to the VAR writer to move.

◆ ~VARWriter()

mage::loader::VARWriter::~VARWriter ( )
default

Destructs this VAR writer.

Member Function Documentation

◆ GetPath()

const std::filesystem::path& mage::Writer::GetPath
noexcept

Returns the current path of this writer.

Returns
A reference to the current path of this writer.

◆ operator=() [1/2]

VARWriter& mage::loader::VARWriter::operator= ( const VARWriter writer)
delete

Copies the given VAR writer to this VAR writer.

Parameters
[in]writerA reference to a VAR writer to copy.
Returns
A reference to the copy of the given VAR writer (i.e. this VAR writer).

◆ operator=() [2/2]

VARWriter& mage::loader::VARWriter::operator= ( VARWriter &&  writer)
delete

Moves the given VAR writer to this VAR writer.

Parameters
[in]writerA reference to a VAR writer to move.
Returns
A reference to the moved VAR writer (i.e. this VAR writer).

◆ Write()

void mage::loader::VARWriter::Write ( )
overrideprivatevirtual

Starts writing.

Exceptions
ExceptionFailed to write.

Implements mage::Writer.

◆ WriteToFile()

void mage::Writer::WriteToFile

Writes to the file associated with the given path.

Parameters
[in]pathThe path.
Exceptions
ExceptionFailed to write to the file.

Member Data Documentation

◆ m_variable_buffer

const ValueMap& mage::loader::VARWriter::m_variable_buffer
private

A reference to a map containing the variables to write by this VAR writer.