xoreos  0.0.5
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Aurora::TwoDARow Class Reference

A row within a 2DA file. More...

#include <2dafile.h>

Inheritance diagram for Aurora::TwoDARow:
Inheritance graph
[legend]
Collaboration diagram for Aurora::TwoDARow:
Collaboration graph
[legend]

Public Member Functions

const Common::UStringgetString (size_t column) const
 Return the contents of a cell as a string. More...
 
const Common::UStringgetString (const Common::UString &column) const
 Return the contents of a cell as a string. More...
 
int32 getInt (size_t column) const
 Return the contents of a cell as an int. More...
 
int32 getInt (const Common::UString &column) const
 Return the contents of a cell as an int. More...
 
float getFloat (size_t column) const
 Return the contents of a cell as a float. More...
 
float getFloat (const Common::UString &column) const
 Return the contents of a cell as a float. More...
 
bool empty (size_t column) const
 Check if the cell is empty. More...
 
bool empty (const Common::UString &column) const
 Check if the cell is empty. More...
 

Private Member Functions

 TwoDARow (TwoDAFile &parent)
 
 ~TwoDARow ()
 
const Common::UStringgetCell (size_t n) const
 

Private Attributes

TwoDAFile_parent
 The parent 2DA. More...
 
std::vector< Common::UString_data
 

Friends

class TwoDAFile
 
template<typename T >
void Common::DeallocatorDefault::destroy (T *)
 

Detailed Description

A row within a 2DA file.

Each row inside a 2DA file contains several cells with string data, identified by either their column index or column header string.

For convenience's sake, there are also methods to directly parse the cell strings into integer or floating point values.

See also class TwoDAFile.

Definition at line 61 of file 2dafile.h.

Constructor & Destructor Documentation

◆ TwoDARow()

Aurora::TwoDARow::TwoDARow ( TwoDAFile parent)
private

Definition at line 53 of file 2dafile.cpp.

◆ ~TwoDARow()

Aurora::TwoDARow::~TwoDARow ( )
private

Definition at line 56 of file 2dafile.cpp.

Member Function Documentation

◆ empty() [1/2]

bool Aurora::TwoDARow::empty ( size_t  column) const

◆ empty() [2/2]

bool Aurora::TwoDARow::empty ( const Common::UString column) const

Check if the cell is empty.

Definition at line 115 of file 2dafile.cpp.

References _parent, empty(), and Aurora::TwoDAFile::headerToColumn().

Here is the call graph for this function:

◆ getCell()

const Common::UString & Aurora::TwoDARow::getCell ( size_t  n) const
private

Definition at line 120 of file 2dafile.cpp.

References _data, and Aurora::kEmpty.

Referenced by empty(), getFloat(), getInt(), and getString().

Here is the caller graph for this function:

◆ getFloat() [1/2]

float Aurora::TwoDARow::getFloat ( size_t  column) const

◆ getFloat() [2/2]

float Aurora::TwoDARow::getFloat ( const Common::UString column) const

Return the contents of a cell as a float.

Definition at line 99 of file 2dafile.cpp.

References Aurora::TwoDAFile::_defaultFloat, _parent, Common::UString::empty(), getCell(), Aurora::TwoDAFile::headerToColumn(), and Aurora::TwoDAFile::parseFloat().

Here is the call graph for this function:

◆ getInt() [1/2]

int32 Aurora::TwoDARow::getInt ( size_t  column) const

Return the contents of a cell as an int.

Definition at line 75 of file 2dafile.cpp.

References Aurora::TwoDAFile::_defaultInt, _parent, Common::UString::empty(), getCell(), and Aurora::TwoDAFile::parseInt().

Referenced by Engines::NWN::CharPackage::callbackActive(), Engines::NWN::CharGenChoices::computeAvailSkillRank(), Engines::NWN::CharSpells::computeRemainingSpells(), Engines::NWN::CharClass::createClassList(), Engines::NWN::CharDomain::createDomainList(), Engines::NWN::CharPackage::createPackageList(), Engines::Jade::Functions::findTable(), Engines::Jade::Functions::get2DAEntryInt(), Engines::Jade::Functions::get2DAEntryIntByString(), Engines::NWN::CharGenChoices::getFeatItems(), Engines::KotOR2::Creature::getPartModels(), Engines::KotOR::Creature::getPartModels(), Engines::NWN::Creature::getPartModels(), Engines::NWN::CharGenChoices::getPrefDomains(), Engines::NWN::CharGenChoices::getPrefFeats(), Engines::NWN::CharGenChoices::getPrefSkills(), Engines::NWN::CharGenChoices::getPrefSpells(), Engines::NWN::CharGenChoices::getPrefSpellSchool(), Engines::NWN::CharGenChoices::getSkillItems(), Engines::NWN::CharGenChoices::hasPrereqFeat(), Engines::NWN::CharPortrait::initPortraitList(), Engines::NWN::CharInfoVoice::initVoicesList(), Engines::KotOR::Item::load(), Engines::KotOR2::Placeable::loadAppearance(), Engines::NWN2::Placeable::loadAppearance(), Engines::KotOR::Placeable::loadAppearance(), Engines::NWN::Placeable::loadAppearance(), Engines::KotOR::Door::loadAppearance(), Engines::KotOR2::Door::loadAppearance(), Engines::NWN2::Door::loadAppearance(), Engines::NWN::Door::loadAppearance(), Engines::NWN2::Creature::loadModel(), Engines::Jade::Placeable::loadProperties(), Engines::NWN::CharFeats::makeAvailList(), Engines::NWN::CharFeats::makeKnownList(), Engines::NWN::CharSpells::makeSpellsList(), Engines::NWN::CharGenChoices::setClass(), Engines::NWN::CharGenChoices::setPackage(), Engines::NWN::CharGenChoices::setRace(), Engines::NWN::CharAttributes::setRecommend(), Engines::NWN::CharAlignment::setRestrict(), and Engines::NWN::CharAttributes::show().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInt() [2/2]

int32 Aurora::TwoDARow::getInt ( const Common::UString column) const

Return the contents of a cell as an int.

Definition at line 83 of file 2dafile.cpp.

References Aurora::TwoDAFile::_defaultInt, _parent, Common::UString::empty(), getCell(), Aurora::TwoDAFile::headerToColumn(), and Aurora::TwoDAFile::parseInt().

Here is the call graph for this function:

◆ getString() [1/2]

const Common::UString & Aurora::TwoDARow::getString ( size_t  column) const

Return the contents of a cell as a string.

Definition at line 59 of file 2dafile.cpp.

References Aurora::TwoDAFile::_defaultString, _parent, Common::UString::empty(), and getCell().

Referenced by Engines::Jade::MainMenu::addBackground(), Engines::NWN::CharPackage::callbackActive(), Engines::NWN::CharSpells::computeRemainingSpells(), Engines::NWN::CharClass::createClassList(), Engines::NWN::CharDomain::createDomainList(), Engines::Jade::Functions::findTable(), Engines::Jade::Functions::get2DAEntryString(), Engines::Jade::Functions::get2DAEntryStringByString(), Engines::NWN::Functions::get2DAString(), Engines::NWN2::Functions::get2DAString(), Engines::Witcher::Functions::get2DAString(), Engines::NWN2::Creature::getBaseModel(), Engines::NWN::CharGenChoices::getFeatItems(), Engines::KotOR2::Creature::getPartModels(), Engines::KotOR::Creature::getPartModels(), Engines::NWN::Creature::getPartModels(), Engines::KotOR::PartySelectionGUI::getPortrait(), Engines::NWN::CharGenChoices::getPrefFeats(), Engines::NWN::CharGenChoices::getPrefSkills(), Engines::NWN::CharGenChoices::getPrefSpells(), Engines::NWN::CharGenChoices::getSkillItems(), Engines::NWN::CharPortrait::initPortraitList(), Engines::NWN::CharInfoVoice::initVoicesList(), Engines::KotOR::Item::load(), Engines::KotOR2::Placeable::loadAppearance(), Engines::NWN2::Placeable::loadAppearance(), Engines::KotOR::Placeable::loadAppearance(), Engines::NWN::Placeable::loadAppearance(), Engines::KotOR::Door::loadAppearance(), Engines::KotOR2::Door::loadAppearance(), Engines::NWN2::Door::loadAppearance(), Engines::NWN::Door::loadAppearance(), Engines::NWN2::Creature::loadArmorModel(), Engines::Jade::Creature::loadBody(), Engines::Jade::Creature::loadHead(), Engines::NWN::Creature::loadModel(), Engines::NWN::Situated::loadPortrait(), Engines::NWN::Item::loadPortrait(), Engines::KotOR2::Situated::loadPortrait(), Engines::KotOR::Situated::loadPortrait(), Engines::KotOR2::Creature::loadPortrait(), Engines::KotOR::Creature::loadPortrait(), Engines::NWN::Creature::loadPortrait(), Engines::Jade::Placeable::loadProperties(), Engines::NWN2::Area::loadProperties(), Engines::NWN::Area::loadProperties(), Engines::KotOR2::Area::loadProperties(), Engines::KotOR::Area::loadProperties(), Engines::Witcher::Situated::loadSounds(), Engines::NWN::Situated::loadSounds(), Engines::NWN2::Situated::loadSounds(), Engines::KotOR2::Situated::loadSounds(), Engines::KotOR::Situated::loadSounds(), Engines::NWN2::Object::loadSSF(), Engines::NWN::Object::loadSSF(), Engines::NWN2::Area::loadTile(), Engines::NWN::CharFeats::makeAvailList(), Engines::NWN::CharFeats::makeKnownList(), Engines::NWN::CharSpells::makeSpellsList(), Graphics::CBGT::readPaletteIndices(), Engines::NWN::CharGenChoices::setClass(), Engines::KotOR2::Area::setMusicBattleTrack(), Engines::NWN2::Area::setMusicBattleTrack(), Engines::NWN::Area::setMusicBattleTrack(), Engines::KotOR::Area::setMusicBattleTrack(), Engines::NWN::CharGenChoices::setPackage(), and Engines::NWN::CharGenChoices::setRace().

Here is the call graph for this function:

◆ getString() [2/2]

const Common::UString & Aurora::TwoDARow::getString ( const Common::UString column) const

Return the contents of a cell as a string.

Definition at line 67 of file 2dafile.cpp.

References Aurora::TwoDAFile::_defaultString, _parent, Common::UString::empty(), getCell(), and Aurora::TwoDAFile::headerToColumn().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ Common::DeallocatorDefault::destroy

template<typename T >
void Common::DeallocatorDefault::destroy ( T *  )
friend

◆ TwoDAFile

friend class TwoDAFile
friend

Definition at line 93 of file 2dafile.h.

Member Data Documentation

◆ _data

std::vector<Common::UString> Aurora::TwoDARow::_data
private

Definition at line 86 of file 2dafile.h.

Referenced by getCell().

◆ _parent

TwoDAFile* Aurora::TwoDARow::_parent
private

The parent 2DA.

Definition at line 84 of file 2dafile.h.

Referenced by empty(), getFloat(), getInt(), and getString().


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