Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Private Attributes | List of all members
blowbox::TextFile Class Reference

#include <text_file.h>

Public Member Functions

 TextFile (const String &file_path)
 
 ~TextFile ()
 
const StringGetFilePath () const
 
const StringGetFileContent () const
 

Private Attributes

String file_path_
 
String file_content_
 

Detailed Description

Wraps the loading and accessing of text files from disk.

TextFile allows you to load a text file from disk based on a given file path. It's content can be requested through TextFile::GetFileContent() which returns a String containing the full contents of the file. Under the hood, we use STL fstream to actually load the file.

Constructor & Destructor Documentation

blowbox::TextFile::TextFile ( const String file_path)

Constructs a TextFile by loading a file from disk based on the supplied file_path argument.

Parameters
[in]file_pathThe path to the file that you wish to load.
blowbox::TextFile::~TextFile ( )

Destructs the TextFile.

Member Function Documentation

const String & blowbox::TextFile::GetFileContent ( ) const

Returns the contents of the file encapsulated by the TextFile.

Returns
The contents of the file encapsulated by the TextFile.
const String & blowbox::TextFile::GetFilePath ( ) const

Returns the file path leading to the file that is encapsulated by the TextFile.

Returns
The file path leading to the file that is encapsulated by the TextFile.

Member Data Documentation

String blowbox::TextFile::file_content_
private

Contents of the file that is encapsulated by the TextFile.

String blowbox::TextFile::file_path_
private

File path to the file that is encapsulated by the TextFile.


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