#include <list_iterator.hpp>
Public Member Functions | |
ListIterator (const lisp::Lisp *cur) | |
const std::string & | item () const |
const lisp::Lisp * | lisp () const |
const lisp::Lisp * | value () const |
bool | next () |
Private Member Functions | |
ListIterator (const ListIterator &) | |
ListIterator & | operator= (const ListIterator &) |
Private Attributes | |
std::string | current_item |
const lisp::Lisp * | current_lisp |
const lisp::Lisp * | cur |
Definition at line 28 of file list_iterator.hpp.
lisp::ListIterator::ListIterator | ( | const lisp::Lisp * | cur | ) |
Definition at line 22 of file list_iterator.cpp.
00022 : 00023 current_item(), 00024 current_lisp(0), 00025 cur(newlisp) 00026 { 00027 }
lisp::ListIterator::ListIterator | ( | const ListIterator & | ) | [private] |
const std::string& lisp::ListIterator::item | ( | ) | const [inline] |
Definition at line 33 of file list_iterator.hpp.
References current_item.
Referenced by BonusBlock::BonusBlock(), AddonManager::check_online(), worldmap::WorldMap::load(), Level::load(), TileSetParser::parse(), Sector::parse(), Sector::parse_old_format(), TileManager::parse_tileset_definition(), Path::read(), JoystickKeyboardController::read(), SpawnPoint::SpawnPoint(), and SpriteData::SpriteData().
00034 { return current_item; }
const lisp::Lisp* lisp::ListIterator::lisp | ( | ) | const [inline] |
Definition at line 35 of file list_iterator.hpp.
References current_lisp.
Referenced by BonusBlock::BonusBlock(), AddonManager::check_online(), worldmap::WorldMap::load(), Level::load(), TileSetParser::parse(), Sector::parse(), Sector::parse_old_format(), TileManager::parse_tileset_definition(), Path::read(), JoystickKeyboardController::read(), and SpriteData::SpriteData().
00036 { return current_lisp; }
const lisp::Lisp* lisp::ListIterator::value | ( | ) | const [inline] |
Definition at line 37 of file list_iterator.hpp.
References current_lisp, and lisp::Lisp::get_car().
Referenced by BonusBlock::BonusBlock(), worldmap::WorldMap::load(), Level::load(), Sector::parse(), Path::read(), SpawnPoint::SpawnPoint(), and SpriteData::SpriteData().
00038 { return current_lisp->get_car(); }
bool lisp::ListIterator::next | ( | ) |
Definition at line 30 of file list_iterator.cpp.
References cur, current_item, current_lisp, lisp::Lisp::get(), lisp::Lisp::get_car(), lisp::Lisp::get_cdr(), lisp::Lisp::get_type(), lisp::Lisp::TYPE_CONS, lisp::Lisp::TYPE_STRING, and lisp::Lisp::TYPE_SYMBOL.
Referenced by BonusBlock::BonusBlock(), AddonManager::check_online(), worldmap::WorldMap::load(), Level::load(), TileSetParser::parse(), Sector::parse(), Sector::parse_old_format(), TileManager::parse_tileset_definition(), Path::read(), JoystickKeyboardController::read(), SpawnPoint::SpawnPoint(), and SpriteData::SpriteData().
00031 { 00032 if(cur == 0) 00033 return false; 00034 00035 const lisp::Lisp* child = cur->get_car(); 00036 if(!child) 00037 throw std::runtime_error("child is 0 in list entry"); 00038 if(child->get_type() != lisp::Lisp::TYPE_CONS) 00039 throw std::runtime_error("Expected CONS"); 00040 const lisp::Lisp* name = child->get_car(); 00041 if(!name || ( 00042 name->get_type() != lisp::Lisp::TYPE_SYMBOL 00043 && name->get_type() != lisp::Lisp::TYPE_STRING)) 00044 throw std::runtime_error("Expected symbol"); 00045 name->get(current_item); 00046 current_lisp = child->get_cdr(); 00047 00048 cur = cur->get_cdr(); 00049 return true; 00050 }
ListIterator& lisp::ListIterator::operator= | ( | const ListIterator & | ) | [private] |
std::string lisp::ListIterator::current_item [private] |
const lisp::Lisp* lisp::ListIterator::current_lisp [private] |
const lisp::Lisp* lisp::ListIterator::cur [private] |