mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 13:01:18 +00:00
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:
12
src/scalar.h
12
src/scalar.h
@@ -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);
|
||||
|
Reference in New Issue
Block a user