Leviathan  0.8.0.0
Leviathan game engine
Leviathan::ObjectFileTextBlockProper Class Reference

Implementation of ObjectFileTextBlock. More...

#include <ObjectFile.h>

+ Inheritance diagram for Leviathan::ObjectFileTextBlockProper:

Public Member Functions

DLLEXPORT ObjectFileTextBlockProper (const std::string &name)
 
DLLEXPORT ~ObjectFileTextBlockProper ()
 
virtual DLLEXPORT void AddTextLine (const std::string &line)
 Adds an UTF8 encoded line. More...
 
virtual DLLEXPORT size_t GetLineCount () const
 Returns the number of text lines. More...
 
virtual DLLEXPORT const std::string & GetLine (size_t index) const
 Gets a line from index ExceptionInvalidArgument when the index is out of bounds. More...
 
virtual DLLEXPORT const std::string & GetName () const
 Gets the name of this text block. More...
 
- Public Member Functions inherited from Leviathan::ObjectFileTextBlock
virtual DLLEXPORT ~ObjectFileTextBlock ()
 

Protected Attributes

std::string Name
 
std::vector< std::string * > Lines
 

Additional Inherited Members

- Protected Member Functions inherited from Leviathan::ObjectFileTextBlock
 ObjectFileTextBlock ()
 

Detailed Description

Implementation of ObjectFileTextBlock.

See also
ObjectFileTextBlock

Definition at line 99 of file ObjectFile.h.

Constructor & Destructor Documentation

◆ ObjectFileTextBlockProper()

DLLEXPORT Leviathan::ObjectFileTextBlockProper::ObjectFileTextBlockProper ( const std::string &  name)

Definition at line 473 of file ObjectFile.cpp.

473  :
474  Name(name) {
475 
476 }

◆ ~ObjectFileTextBlockProper()

DLLEXPORT Leviathan::ObjectFileTextBlockProper::~ObjectFileTextBlockProper ( )

Definition at line 478 of file ObjectFile.cpp.

478  {
480 }
std::vector< std::string * > Lines
Definition: ObjectFile.h:116
#define SAFE_DELETE_VECTOR(x)
Definition: Define.h:165

Member Function Documentation

◆ AddTextLine()

DLLEXPORT void Leviathan::ObjectFileTextBlockProper::AddTextLine ( const std::string &  line)
virtual

Adds an UTF8 encoded line.

Implements Leviathan::ObjectFileTextBlock.

Definition at line 503 of file ObjectFile.cpp.

503  {
504  Lines.push_back(new string(line));
505 }
std::vector< std::string * > Lines
Definition: ObjectFile.h:116

◆ GetLine()

DLLEXPORT const string & Leviathan::ObjectFileTextBlockProper::GetLine ( size_t  index) const
virtual

Gets a line from index ExceptionInvalidArgument when the index is out of bounds.

See also
GetLineCount

Implements Leviathan::ObjectFileTextBlock.

Definition at line 490 of file ObjectFile.cpp.

490  {
491  // Check the index //
492  if (index >= Lines.size()) {
493  #ifndef ALTERNATIVE_EXCEPTIONS_FATAL
494  throw InvalidArgument("index is out of range");
495  #else
496  LEVIATHAN_ASSERT(false, "index is over Lines.size()");
497  #endif
498  }
499 
500  return *Lines[index];
501 }
std::vector< std::string * > Lines
Definition: ObjectFile.h:116
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:92

◆ GetLineCount()

DLLEXPORT size_t Leviathan::ObjectFileTextBlockProper::GetLineCount ( ) const
virtual

Returns the number of text lines.

Implements Leviathan::ObjectFileTextBlock.

Definition at line 486 of file ObjectFile.cpp.

486  {
487  return Lines.size();
488 }
std::vector< std::string * > Lines
Definition: ObjectFile.h:116

◆ GetName()

DLLEXPORT const string & Leviathan::ObjectFileTextBlockProper::GetName ( ) const
virtual

Gets the name of this text block.

Implements Leviathan::ObjectFileTextBlock.

Definition at line 482 of file ObjectFile.cpp.

482  {
483  return Name;
484 }

Member Data Documentation

◆ Lines

std::vector<std::string*> Leviathan::ObjectFileTextBlockProper::Lines
protected

Definition at line 116 of file ObjectFile.h.

◆ Name

std::string Leviathan::ObjectFileTextBlockProper::Name
protected

Definition at line 115 of file ObjectFile.h.


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