Makes sense. I was trying to keep it as simple as possible so that it would
only deal with strings since XML is always just strings and OF has
utilities for data conversion elsewhere, but it would "fit" better if it
had templated methods for base types. I'll add that this afternoon.


On Mon, Jun 10, 2013 at 9:14 AM, Kyle McDonald <notifications@github.com>wrote:

> In libs/openFrameworks/types/ofXml.h:
>
> > +
> > +class ofXml {
> > +
> > +public:
> > +
> > +    ofXml();
> > +    ~ofXml();
> > +
> > +    ofXml( const ofXml& rhs );
> > +    const ofXml& operator =( const ofXml& rhs );
> > +
> > +    bool            addValue(const string& path, const string& value, bool createEntirePath = false);
> > +    bool            addChild( const string& path );
> > +    void            addXml( ofXml& xml, bool copyAll = false);
> > +
> > +    string          getValue(const string& path);
>
> it could be very helpful to have a templated getValue() as well where you
> pass a reference to the thing you want to fill.
>
> template <class T> void getValue(const string& path, T& data)
> {stringstream str; str << getValue(path); str >> data;}
>
> or similar. it should also work with ofVec2f and other basic OF datatypes
> that overload >>
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/openframeworks/openFrameworks/pull/2084/files#r4615209>
> .
>



-- 
joshua noble
http://thefactoryfactory.com