UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Attributes | Friends | List of all members
SafeXTString< T > Class Template Reference

This template provides a container which automatically releases a transcoded string, when the pointer runs out of scope. More...

#include <xercesc_helpers.h>

Public Member Functions

 SafeXTString (T *ptr)
 Generates a new SafeXTString with the specified (transcoded) string pointer as content. More...
 
virtual ~SafeXTString ()
 Destroys this SafeXTString object. More...
 
T * getContent ()
 Returns the content stored in this SafeXTString object. More...
 
SafeXTString< T > & operator= (T *data)
 Replaces the content of this container object with the given content. More...
 

Private Attributes

T * stringPtr
 This pointer represent a string transcoded by Xercesc.
 

Friends

std::ostream & operator<< (std::ostream &ost, SafeXTString< T > &data)
 Applying this operator will stream out the content of this object without alteration. More...
 

Detailed Description

template<class T>
class uncover::io::SafeXTString< T >

This template provides a container which automatically releases a transcoded string, when the pointer runs out of scope.

Author
Jan Stückrath

Constructor & Destructor Documentation

SafeXTString ( T *  ptr)
inline

Generates a new SafeXTString with the specified (transcoded) string pointer as content.

Parameters
ptra transcoded string pointer which will be safely stored
virtual ~SafeXTString ( )
inlinevirtual

Destroys this SafeXTString object.

The contained string is thereby properly released.

Member Function Documentation

T* getContent ( )
inline

Returns the content stored in this SafeXTString object.

Note that the returned pointer may not be released, since it will be released automatically when this object is destroyed.

Returns
the content stored in this SafeXTString object
SafeXTString<T>& operator= ( T *  data)
inline

Replaces the content of this container object with the given content.

Applying the = operator will properly release old content and store the new content.

Parameters
datathe new content to be stored
Returns
a reference to this container object

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ost,
SafeXTString< T > &  data 
)
friend

Applying this operator will stream out the content of this object without alteration.

This operator must also be defined for the content.

Parameters
ostthe output stream
datathe SafeXTString object to be streamed
Returns
the output stream

The documentation for this class was generated from the following file: