Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Parsing an XML file using ticpp (tinyxml++) using streaming operators #69

Description

@GoogleCodeExporter
I'd like to utilize the streaming operator to parse an XML file with ticpp 
(tinyxml ++ ). I've not been able to find any examples on this. The ticpp 
documentation says only a little bit about streaming support.

I'd like to initialize streaming in with the following:

ifstream in;
in.open( m_sConfigFile, std::ios::in );

if( in.good() )
    in >> *this;
I'm not sure how to write the stream in function:

std::istream & operator >> ( std::istream & in, EffectMgr & r )
{   
    return in;
}
My XML file looks like this:

<? xml version="1.0" ?>

<EffectsMgr>
    <Effect name="textured-phong" >
        <Shader name="textured-phong.vert" type="Vertex" />
        <Shader name="textured-phong.frag" type="Fragment" />
        <VertexClass name="CustomVertex" />
        <Attribute name="VertexPosition" size="3" offset="0" />
        <Attribute name="VertexNormal" size="3" offset="3" />
        <Attribute name="VertexTexCoord" size="3" offset="6" />
    </Effect>
</EffectsMgr>
Are there any examples out there I should check out?

Original issue reported on code.google.com by johnny.m...@gmail.com on 19 Feb 2012 at 12:36

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions