xoreos
0.0.5
|
A row within a 2DA file. More...
#include <2dafile.h>
Public Member Functions | |
const Common::UString & | getString (size_t column) const |
Return the contents of a cell as a string. More... | |
const Common::UString & | getString (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::UString & | getCell (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 *) |
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.
|
private |
Definition at line 53 of file 2dafile.cpp.
|
private |
Definition at line 56 of file 2dafile.cpp.
bool Aurora::TwoDARow::empty | ( | size_t | column | ) | const |
Check if the cell is empty.
Definition at line 107 of file 2dafile.cpp.
References 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(), empty(), Engines::NWN::CharGenChoices::getFeatItems(), Engines::NWN::CharGenChoices::getPrefSpellSchool(), Engines::NWN::CharGenChoices::hasPrereqFeat(), Engines::NWN::CharPortrait::initPortraitList(), Engines::NWN::CharSpells::makeSpellsList(), and Engines::NWN::CharGenChoices::setPackage().
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().
|
private |
Definition at line 120 of file 2dafile.cpp.
References _data, and Aurora::kEmpty.
Referenced by empty(), getFloat(), getInt(), and getString().
float Aurora::TwoDARow::getFloat | ( | size_t | column | ) | const |
Return the contents of a cell as a float.
Definition at line 91 of file 2dafile.cpp.
References Aurora::TwoDAFile::_defaultFloat, _parent, Common::UString::empty(), getCell(), and Aurora::TwoDAFile::parseFloat().
Referenced by Engines::Jade::Functions::get2DAEntryFloat(), Engines::Jade::Functions::get2DAEntryFloatByString(), Engines::KotOR2::Area::loadCameraStyle(), Engines::KotOR::Area::loadCameraStyle(), and Engines::KotOR::Creature::loadMovementRate().
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().
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().
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().
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().
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().
|
friend |
|
private |
|
private |
The parent 2DA.
Definition at line 84 of file 2dafile.h.
Referenced by empty(), getFloat(), getInt(), and getString().