mimas::xml_reference< T > Class Template Reference
[XML parser]

Wrapper for XML-Nodes. More...

#include <xml_reference.h>

Inheritance diagram for mimas::xml_reference< T >:

Inheritance graph
[legend]
Collaboration diagram for mimas::xml_reference< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 xml_reference (T *_node, xml_document *_document)
 Constructor for internal use only.
 xml_reference (const xml_reference< T > &r)
 Copy-constructor.
xml_reference< T > & operator= (const xml_reference< T > &r)
 Assignment-operator.
T & operator * (void) const
 Dereferencing-operator.
T * operator-> (void) const
 Dereferencing-operator.
T * get (void) const
 Get pointer to wrapped object.
 operator bool (void) const
 Check pointer for being not-null.
bool operator! () const
 Check pointer for being null.
std::string getNodeText (void) const throw (mimasexception,XMLException)
 Get text contained in this node.
xml_reference< XalanNode > selectNode (const char *xPath) const throw (mimasexception,XMLException)
 Select node with given X-path.
xml_node_reference_list selectNodes (const char *xPath) const throw (mimasexception,XMLException)
 Select list of nodes with given X-path.
bool existNode (const char *xPath) const throw (XMLException)
 Check for node with given X-path.
xml_documentgetDocument (void) const
 Get pointer to parent document.

Protected Attributes

T * node
 Pointer to node being wrapped.
xml_documentdocument
 Pointer to parent document.

Detailed Description

template<class T>
class mimas::xml_reference< T >

Wrapper for XML-Nodes.

This wrapper is used to wrap references to objects of type XalanNode and XalanElement.

See also:
xml_document.
Author:
Jan Wedekind (jan at wedesoft.de)
Date:
Wed Jan 12 13:53:41 UTC 2004

Definition at line 36 of file xml_reference.h.


Constructor & Destructor Documentation

template<class T>
mimas::xml_reference< T >::xml_reference ( T *  _node,
xml_document _document 
)

Constructor for internal use only.

template<class T>
mimas::xml_reference< T >::xml_reference ( const xml_reference< T > &  r  ) 

Copy-constructor.


Member Function Documentation

template<class T>
xml_reference< T >& mimas::xml_reference< T >::operator= ( const xml_reference< T > &  r  ) 

Assignment-operator.

template<class T>
T& mimas::xml_reference< T >::operator * ( void   )  const [inline]

Dereferencing-operator.

Returns:
Reference to wrapped object.

Definition at line 47 of file xml_reference.h.

References mimas::xml_reference< T >::node.

template<class T>
T* mimas::xml_reference< T >::operator-> ( void   )  const [inline]

Dereferencing-operator.

Returns:
Reference to wrapped object.

Definition at line 50 of file xml_reference.h.

References mimas::xml_reference< T >::node.

template<class T>
T* mimas::xml_reference< T >::get ( void   )  const [inline]

Get pointer to wrapped object.

Returns:
Pointer to wrapped object.

Definition at line 53 of file xml_reference.h.

References mimas::xml_reference< T >::node.

Referenced by mimas::dynamic_pointer_cast().

template<class T>
mimas::xml_reference< T >::operator bool ( void   )  const [inline]

Check pointer for being not-null.

Returns:
true, if pointer is not NULL.

Definition at line 56 of file xml_reference.h.

References mimas::xml_reference< T >::node.

template<class T>
bool mimas::xml_reference< T >::operator! ( void   )  const [inline]

Check pointer for being null.

Returns:
true, if pointer is NULL.

Definition at line 59 of file xml_reference.h.

References mimas::xml_reference< T >::node.

template<class T>
std::string mimas::xml_reference< T >::getNodeText ( void   )  const throw (mimasexception,XMLException)

Get text contained in this node.

Returns:
Sum of text-elements in the sub-tree.

template<class T>
xml_reference< XalanNode > mimas::xml_reference< T >::selectNode ( const char *  xPath  )  const throw (mimasexception,XMLException)

Select node with given X-path.

This method is only implemented for T=XalanElement!

To convert xml_refence<XalanNode> to xml_refence<XalanElement> do:

      using namespace mimas;
      ...
      xml_reference< XalanElement > =
         dynamic_pointer_cast< XalanElement >( ... );
      ...
Parameters:
xPath X-Path to the desired node.
Returns:
Wrapper containing desired node.

template<class T>
xml_node_reference_list mimas::xml_reference< T >::selectNodes ( const char *  xPath  )  const throw (mimasexception,XMLException)

Select list of nodes with given X-path.

This method is only implemented for T=XalanElement!

Parameters:
xPath X-Path for finding the desired nodes.
Returns:
Wrapper containing list of desired nodes.

template<class T>
bool mimas::xml_reference< T >::existNode ( const char *  xPath  )  const throw (XMLException)

Check for node with given X-path.

This method only is implemented for XalanElement! The method will yield the same result as the following code:

      ( selectNodes( xPath ).getLength() > 0 )
Parameters:
xPath X-Path of node(s) to check for.
Returns:
true if there is a node with such path.

template<class T>
xml_document* mimas::xml_reference< T >::getDocument ( void   )  const [inline]

Get pointer to parent document.

For internal use only.

Definition at line 96 of file xml_reference.h.

References mimas::xml_reference< T >::document.

Referenced by mimas::dynamic_pointer_cast().


Member Data Documentation

template<class T>
T* mimas::xml_reference< T >::node [protected]

Pointer to node being wrapped.

Definition at line 99 of file xml_reference.h.

Referenced by mimas::xml_reference< T >::get(), mimas::xml_reference< T >::operator *(), mimas::xml_reference< T >::operator bool(), mimas::xml_reference< T >::operator!(), and mimas::xml_reference< T >::operator->().

template<class T>
xml_document* mimas::xml_reference< T >::document [protected]

Pointer to parent document.

Definition at line 101 of file xml_reference.h.

Referenced by mimas::xml_reference< T >::getDocument().


The documentation for this class was generated from the following file:
[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:48 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...