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:
jbeder
2009-05-23 23:51:01 +00:00
parent 0c34137d84
commit 51457eece9
12 changed files with 158 additions and 270 deletions

View File

@@ -17,14 +17,10 @@ namespace YAML
virtual bool IsScalar() const { return true; }
// extraction
virtual bool Read(std::string& s) const;
virtual bool Read(int& i) const;
virtual bool Read(unsigned& u) const;
virtual bool Read(long& l) const;
virtual bool Read(float& f) const;
virtual bool Read(double& d) const;
virtual bool Read(char& c) const;
virtual bool Read(bool& b) const;
virtual bool GetScalar(std::string& scalar) const {
scalar = m_data;
return true;
}
// ordering
virtual int Compare(Content *pContent);