mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Specialized the overloaded [] operator for int/unsigned, and added a size() function, so that you can iterate through a sequence node like a vector.
This commit is contained in:
parent
2ccbfeff47
commit
2be40919de
8 changed files with 81 additions and 25 deletions
16
sequence.cpp
16
sequence.cpp
|
@ -22,18 +22,30 @@ namespace YAML
|
|||
m_data.clear();
|
||||
}
|
||||
|
||||
bool Sequence::GetBegin(std::vector <Node *>::const_iterator& it)
|
||||
bool Sequence::GetBegin(std::vector <Node *>::const_iterator& it) const
|
||||
{
|
||||
it = m_data.begin();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Sequence::GetEnd(std::vector <Node *>::const_iterator& it)
|
||||
bool Sequence::GetEnd(std::vector <Node *>::const_iterator& it) const
|
||||
{
|
||||
it = m_data.end();
|
||||
return true;
|
||||
}
|
||||
|
||||
Node *Sequence::GetNode(unsigned i) const
|
||||
{
|
||||
if(i < m_data.size())
|
||||
return m_data[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned Sequence::GetSize() const
|
||||
{
|
||||
return m_data.size();
|
||||
}
|
||||
|
||||
void Sequence::Parse(Scanner *pScanner, const ParserState& state)
|
||||
{
|
||||
Clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue