V-Gears 0
Free Final Fantasy VII engine.
FieldTextWriter Class Reference

Handles the. More...

#include <FieldTextWriter.h>

Public Member Functions

void Begin (std::string file_name)
 Initializes the text file. More...
 
void Write (const std::vector< u8 > &script_section_buffer, std::string field_name, bool english=true)
 Writes text to the XML file. More...
 
void End ()
 Finalizes the text file. More...
 

Private Member Functions

void AddText (std::vector< unsigned char > &text)
 Adds text. More...
 
u16 GetU16LE (u32 offset)
 Reads 16 bytes of data from the data (little endian). More...
 
u8 GetU8 (u32 offset)
 Reads 8 bytes of data from the data. More...
 

Private Attributes

std::unique_ptr< Loggerlogger_
 The logger used to write text. More...
 
std::vector< u8data_
 The data being read. More...
 
bool tag_open_ = false
 Indicates if the text XML tag has been opened and not closed. More...
 

Detailed Description

Handles the.

Member Function Documentation

◆ AddText()

void FieldTextWriter::AddText ( std::vector< unsigned char > &  text)
private

Adds text.

Parameters
[in]textThe text to add.

◆ Begin()

void FieldTextWriter::Begin ( std::string  file_name)

Initializes the text file.

Writes the XML text section opening tag.

Parameters
[in]file_namePath to the file to write te text to.

◆ End()

void FieldTextWriter::End ( )

Finalizes the text file.

Writes the XML text section closing tag.

◆ GetU16LE()

u16 FieldTextWriter::GetU16LE ( u32  offset)
private

Reads 16 bytes of data from the data (little endian).

Parameters
[in]offsetOffset at which to read.
Returns
16 bytes of data at the specified offset.
Exceptions
std::out_of_rangeIf the offset is out of the data.

◆ GetU8()

u8 FieldTextWriter::GetU8 ( u32  offset)
private

Reads 8 bytes of data from the data.

Parameters
[in]offsetOffset at which to read.
Returns
8 bytes of data at the specified offset.
Exceptions
std::out_of_rangeIf the offset is out of the data.

◆ Write()

void FieldTextWriter::Write ( const std::vector< u8 > &  script_section_buffer,
std::string  field_name,
bool  english = true 
)

Writes text to the XML file.

Parameters
[in]script_section_bufferThe text data to write.
[in]field_nameThe field of the text.
[in]englishTrue if the language to write is english.

Member Data Documentation

◆ data_

std::vector<u8> FieldTextWriter::data_
private

The data being read.

◆ logger_

std::unique_ptr<Logger> FieldTextWriter::logger_
private

The logger used to write text.

◆ tag_open_

bool FieldTextWriter::tag_open_ = false
private

Indicates if the text XML tag has been opened and not closed.


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