Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlXmlAttributeI Class Referenceabstract

Interface for XML attributes. More...

#include <ilog/xml.h>

Inheritance diagram for IlXmlAttributeI:
IlXmlNodeI IlXmlAttribute

Public Member Functions

virtual ~IlXmlAttributeI ()
 Destructor. More...
 
virtual const char * getName () const =0
 Gets the name of this attribute. More...
 
virtual Type getType () const
 Retrieves the type of this element. More...
 
virtual const char * getValue () const =0
 Gets the value of this attribute. More...
 
virtual void setName (const char *name)
 Sets the name of this attribute. More...
 
virtual void setValue (const char *value)
 Sets the value of this attribute. More...
 
virtual void storeName (char *name)=0
 Stores the name of this attribute. More...
 
virtual void storeValue (char *value)=0
 Stores the value of this attribute. More...
 
virtual std::ostream & write (std::ostream &stream) const
 Writes the XML code for this attribute. More...
 

Additional Inherited Members

- Public Types inherited from IlXmlNodeI
enum  Type {
  Attribute, Element, Text, Comment,
  CData, PI, CharRef, EntityRef
}
 The different types of XML nodes. More...
 

Detailed Description

Interface for XML attributes.

Library: ilog

This interface defines the entire interface of XML attribute objects. An attribute is a key-pair couple that is stored in an IlXmlElementI.

Constructor & Destructor Documentation

◆ ~IlXmlAttributeI()

virtual IlXmlAttributeI::~IlXmlAttributeI ( )
virtual

Destructor.

The default implementation does nothing.

Member Function Documentation

◆ getName()

virtual const char* IlXmlAttributeI::getName ( ) const
pure virtual

Gets the name of this attribute.

Returns
The name of this attribute. The returned string must not be deleted or modified.

Implemented in IlXmlAttribute.

◆ getType()

virtual Type IlXmlAttributeI::getType ( ) const
virtual

Retrieves the type of this element.

Returns
IlXmlNodeI::Attribute.

Implements IlXmlNodeI.

◆ getValue()

virtual const char* IlXmlAttributeI::getValue ( ) const
pure virtual

Gets the value of this attribute.

You must provide an implementation of getValue() if you create a subclass of IlXmlAttributeI.

Returns
The value of this attribute. The returned string must not be deleted or modified.

Implemented in IlXmlAttribute.

◆ setName()

virtual void IlXmlAttributeI::setName ( const char *  name)
virtual

Sets the name of this attribute.

You must provide an implementation of getName() if you create a subclass of IlXmlAttributeI.
The default implementation calls storeName() with a copy of the provided string.

Parameters
nameThe new name of this attribute. The string is copied.

◆ setValue()

virtual void IlXmlAttributeI::setValue ( const char *  value)
virtual

Sets the value of this attribute.

The default implementation calls storeValue with a copy of the provided string.

Parameters
valueThe new value of this attribute. The string is copied.

◆ storeName()

virtual void IlXmlAttributeI::storeName ( char *  name)
pure virtual

Stores the name of this attribute.

You must provide an implementation of storeName() if you create a subclass of IlXmlAttributeI.

Parameters
nameThe new name of this attribute. The string is directly stored in this object. No copy is performed.

Implemented in IlXmlAttribute.

◆ storeValue()

virtual void IlXmlAttributeI::storeValue ( char *  value)
pure virtual

Stores the value of this attribute.

You must provide an implementation of storeValue if you create a subclass of IlXmlAttributeI.

Parameters
valueThe new value of this attribute. The string is directly stored in this object. No copy is performed.

Implemented in IlXmlAttribute.

◆ write()

virtual std::ostream& IlXmlAttributeI::write ( std::ostream &  stream) const
virtual

Writes the XML code for this attribute.

The default implementation writes the attribute name, followed by an equal (=) sign, followed by the attribute value stored within double quotes (").

Parameters
streamThe output stream where the XML code will be sent.
Returns
A reference to the provided output stream.

Implements IlXmlNodeI.