Hey Arturo,

Part of the reason this took me so long was that I really wanted to get
that object based approach that you're referencing but I couldn't get Pocos
internal auto_ptr to play nicely with ofPtr/shared_ptr without leaking
memory and causing really weird behavior on copy and on destruction. All
the DOM objects, nodes, attributes, documents, etc, are auto_ptrs and
they're fairly limiting in terms of what they can do. I'd looove to revisit
it, but I figured at this point it'd be better to get something than to
sink more time into the weeks I had spent trying to get that to work right
:(

I think you're right about the "currentElement" showing too much inner
workings. Maybe we can just do "pointTo" or "setTo"? Both of those seem
both sensible and less verbose.


On Tue, Jun 11, 2013 at 10:38 AM, arturo <notifications@github.com> wrote:

> In libs/openFrameworks/types/ofXml.h:
>
> > +    bool            clearContents(const string& path);
> > +    bool            clearContents();
> > +
> > +    bool            remove(const string& path); // works for both attributes and tags
> > +    //bool            removeAll(const string& path); // works for both attributes and tags
> > +    bool            exists(const string& path); // works for both attributes and tags
> > +
> > +    string          getCurrentElementName();
> > +    bool            resetCurrentElement();
> > +
> > +    bool            setCurrentElementToChild(int index);
> > +    bool            setCurrentElement(const string& path);
> > +    bool            setCurrentElementToParent();
> > +    bool            setCurrentElementToParent(int numLevelsUp);
> > +    bool            setCurrentElementToSibling();
> > +    bool            setCurrentElementToPrevSibling();
>
> I also find setElement a little confusing, perhaps it reveals the inner
> workings more than necessary but not sure what would be a good name,
> pointTo?.
>
> Also i liked the old syntax you had where you got objects for each element
> you wanted to modify but perhaps we can add it back later or just use it
> through the Poco object getters, perhaps add also getParentElement,
> getSiblingElement...?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/openframeworks/openFrameworks/pull/2084/files#r4639240>
> .
>



-- 
joshua noble
http://thefactoryfactory.com