openddl-parser: latest greatest.

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
pull/502/head
Kim Kulling 2015-01-31 21:23:50 +01:00
parent 0e579bfb06
commit e9dcad4181
4 changed files with 21 additions and 15 deletions

View File

@ -116,14 +116,6 @@ const std::string &DDLNode::getName() const {
return m_name; return m_name;
} }
void DDLNode::setProperties( Property *first ) {
m_properties = first;
}
Property *DDLNode::getProperties() const {
return m_properties;
}
void DDLNode::setValue( Value *val ) { void DDLNode::setValue( Value *val ) {
m_value = val; m_value = val;
} }

View File

@ -72,7 +72,7 @@ static bool isIntegerType( Value::ValueType integerType ) {
return true; return true;
} }
static DDLNode *createDDLNode( Identifier *id, Property *first, OpenDDLParser *parser ) { static DDLNode *createDDLNode( Identifier *id, OpenDDLParser *parser ) {
if( nullptr == id || ddl_nullptr == parser ) { if( nullptr == id || ddl_nullptr == parser ) {
return ddl_nullptr; return ddl_nullptr;
} }
@ -80,9 +80,6 @@ static DDLNode *createDDLNode( Identifier *id, Property *first, OpenDDLParser *p
const std::string type( id->m_buffer ); const std::string type( id->m_buffer );
DDLNode *parent( parser->top() ); DDLNode *parent( parser->top() );
DDLNode *node = DDLNode::create( type, "", parent ); DDLNode *node = DDLNode::create( type, "", parent );
if( ddl_nullptr != first ) {
node->setProperties( first );
}
return node; return node;
} }
@ -254,8 +251,13 @@ char *OpenDDLParser::parseHeader( char *in, char *end ) {
in++; in++;
} }
// set the properties
if( ddl_nullptr != first ) {
m_context->setProperties( first );
}
// store the node // store the node
DDLNode *node( createDDLNode( id, first, this ) ); DDLNode *node( createDDLNode( id, this ) );
if( nullptr != node ) { if( nullptr != node ) {
pushNode( node ); pushNode( node );
} else { } else {

View File

@ -55,8 +55,6 @@ public:
const std::string &getType() const; const std::string &getType() const;
void setName( const std::string &name ); void setName( const std::string &name );
const std::string &getName() const; const std::string &getName() const;
void setProperties( Property *first );
Property *getProperties() const;
void setValue( Value *val ); void setValue( Value *val );
Value *getValue() const; Value *getValue() const;
void setDataArrayList( DataArrayList *dtArrayList ); void setDataArrayList( DataArrayList *dtArrayList );

View File

@ -141,8 +141,22 @@ struct Context {
, m_root( ddl_nullptr ) { , m_root( ddl_nullptr ) {
// empty // empty
} }
void setProperties( Property *first );
Property *getProperties() const;
}; };
inline
void Context::setProperties( Property *first ) {
m_properties = first;
}
inline
Property *Context::getProperties() const {
return m_properties;
}
END_ODDLPARSER_NS END_ODDLPARSER_NS
#define ODDL_NO_COPYING( classname ) \ #define ODDL_NO_COPYING( classname ) \