Changed the way we read different types of scalars.

It's better organized now, I think - nodes only offer a single main way of getting the fundamental scalar (as a string), and now we can specialize a single template to read specific types.
This commit is contained in:
Jesse Beder
2009-05-23 23:51:01 +00:00
parent b952bc594f
commit e76521c0e9
12 changed files with 158 additions and 270 deletions

View File

@@ -63,44 +63,9 @@ namespace YAML
return m_pRef->IsSequence();
}
bool Alias::Read(std::string& v) const
bool Alias::GetScalar(std::string& scalar) const
{
return m_pRef->Read(v);
}
bool Alias::Read(int& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(unsigned& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(long& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(float& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(double& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(char& v) const
{
return m_pRef->Read(v);
}
bool Alias::Read(bool& v) const
{
return m_pRef->Read(v);
return m_pRef->GetScalar(scalar);
}
int Alias::Compare(Content *pContent)