Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

XMLOutput Class Reference

#include <XMLOutput.hpp>

Inheritance diagram for XMLOutput::

Output List of all members.

Public Methods

void OUTPUT_STATIC Init (unsigned char myintentation, unsigned char myvaluespacing=0, unsigned char mycoldelta=1)
 XMLOutput ()
void OUTPUT_STATIC startElement (char *str, int len)
void OUTPUT_STATIC endElement (char *str, int len)
void OUTPUT_STATIC endEmptyElement ()
void OUTPUT_STATIC startAttribute (char *str, int len)
void OUTPUT_STATIC endAttribute (char *str=NULL, int len=0)
void OUTPUT_STATIC characters (char *str, int len)
void OUTPUT_STATIC whitespaces (char *str, int len)
void OUTPUT_STATIC attribWhitespaces (char *str, int len)

Constructor & Destructor Documentation

XMLOutput::XMLOutput   [inline]
 

Definition at line 96 of file XMLOutput.hpp.

00097    {
00098       Init(XMLINTENT_NONE);
00099    }


Member Function Documentation

void OUTPUT_STATIC XMLOutput::Init unsigned char    myintentation,
unsigned char    myvaluespacing = 0,
unsigned char    mycoldelta = 1
[inline]
 

Definition at line 84 of file XMLOutput.hpp.

Referenced by InterpretOptionString(), and XMLOutput().

00085    {
00086       curcol=0;
00087       coldelta=mycoldelta;
00088       x.intentation=myintentation;
00089 
00090       x.status=XMLOUTPUT_INIT;
00091       x.isinattrib=0;
00092 
00093       x.valuespacing=myvaluespacing;
00094    }

void OUTPUT_STATIC XMLOutput::attribWhitespaces char *    str,
int    len
[inline]
 

Definition at line 260 of file XMLOutput.hpp.

00261    {
00262       char *ptr=GetDataPtr(len);
00263       mymemcpy(ptr,str,len);
00264       x.attribwhitespace=1;
00265    }

void OUTPUT_STATIC XMLOutput::characters char *    str,
int    len
[inline]
 

Definition at line 236 of file XMLOutput.hpp.

Referenced by whitespaces().

00237    {
00238       switch(x.status)
00239       {
00240       case XMLOUTPUT_OPENATTRIB:
00241          StoreData(str,len);
00242          return;
00243 
00244       case XMLOUTPUT_OPENLABEL:
00245          StoreChar('>');
00246 
00247       case XMLOUTPUT_AFTERDATA:
00248       case XMLOUTPUT_AFTERENDLABEL:
00249       case XMLOUTPUT_INIT:
00250          StoreData(str,len);
00251       }
00252       x.status=XMLOUTPUT_AFTERDATA;
00253    }

void OUTPUT_STATIC XMLOutput::endAttribute char *    str = NULL,
int    len = 0
[inline]
 

Definition at line 225 of file XMLOutput.hpp.

00226    {
00227       if(x.status!=XMLOUTPUT_OPENATTRIB)
00228       {
00229          Error("Could not finish attribute outside of start element!");
00230          Exit();
00231       }
00232       StoreChar('"');
00233       x.status=XMLOUTPUT_OPENLABEL;
00234    }

void OUTPUT_STATIC XMLOutput::endElement char *    str,
int    len
[inline]
 

Definition at line 135 of file XMLOutput.hpp.

00136    {
00137       char *ptr;
00138       switch(x.status)
00139       {
00140       case XMLOUTPUT_OPENLABEL:
00141          ptr=GetDataPtr(len+4);
00142          *(ptr++)='>';
00143          *(ptr++)='<';
00144          *(ptr++)='/';
00145          mymemcpy(ptr,str,len);
00146          ptr+=len;
00147          *(ptr++)='>';
00148          curcol-=coldelta;
00149          x.status=XMLOUTPUT_AFTERENDLABEL;
00150          return;
00151 
00152       case XMLOUTPUT_AFTERENDLABEL:
00153          GotoNextLine(0);
00154          break;
00155 
00156       case XMLOUTPUT_AFTERDATA:
00157          curcol-=coldelta;
00158          break;
00159 
00160       default:
00161          Error("Invalid end tag");
00162          Exit();
00163       }
00164 
00165       ptr=GetDataPtr(len+3);
00166 
00167       *(ptr++)='<';
00168       *(ptr++)='/';
00169       mymemcpy(ptr,str,len);
00170       ptr+=len;
00171       *(ptr++)='>';
00172       
00173       x.status=XMLOUTPUT_AFTERENDLABEL;
00174    }

void OUTPUT_STATIC XMLOutput::endEmptyElement   [inline]
 

Definition at line 176 of file XMLOutput.hpp.

00177    {
00178       char *ptr;
00179       if(x.status!=XMLOUTPUT_OPENLABEL)
00180          // Something is wrong !!
00181          return;
00182 
00183       ptr=GetDataPtr(2);
00184       *(ptr++)='/';
00185       *(ptr++)='>';
00186 
00187       x.status=XMLOUTPUT_AFTERENDLABEL;
00188       curcol-=coldelta;
00189    }

void OUTPUT_STATIC XMLOutput::startAttribute char *    str,
int    len
[inline]
 

Definition at line 193 of file XMLOutput.hpp.

00194    {
00195       register char *ptr;
00196 
00197       if(x.status==XMLOUTPUT_OPENATTRIB)
00198       {
00199          ptr=GetDataPtr(len+(x.attribwhitespace ? 3 : 4));
00200          *(ptr++)='"';
00201       }
00202       else
00203       {
00204          if(x.status!=XMLOUTPUT_OPENLABEL)
00205          {
00206             Error("Cannot print attribute outside of start element!");
00207             Exit();
00208          }
00209          ptr=GetDataPtr(len+(x.attribwhitespace ? 2 : 3));
00210       }
00211       if(x.attribwhitespace==0)
00212       {
00213          *(ptr++)=' ';
00214          x.attribwhitespace=0;
00215       }
00216 
00217       mymemcpy(ptr,str,len);
00218       ptr+=len;
00219       *(ptr++)='=';
00220       *(ptr++)='"';
00221 
00222       x.status=XMLOUTPUT_OPENATTRIB;
00223    }

void OUTPUT_STATIC XMLOutput::startElement char *    str,
int    len
[inline]
 

Definition at line 105 of file XMLOutput.hpp.

00106    {
00107       switch(x.status)
00108       {
00109       case XMLOUTPUT_OPENLABEL:
00110          StoreChar('>');
00111          GotoNextLine(1);
00112          break;
00113 
00114       case XMLOUTPUT_OPENATTRIB:
00115          Error("Cannot start element within attribute!");
00116          Exit();
00117 
00118       case XMLOUTPUT_AFTERENDLABEL:
00119       case XMLOUTPUT_AFTERDATA:
00120          GotoNextLine(1);
00121          break;
00122 
00123       case XMLOUTPUT_INIT:
00124          curcol+=coldelta;
00125          break;
00126       }
00127       StoreChar('<');
00128 
00129       x.status=XMLOUTPUT_OPENLABEL;
00130       StoreData(str,len);
00131 
00132       x.attribwhitespace=0;
00133    }

void OUTPUT_STATIC XMLOutput::whitespaces char *    str,
int    len
[inline]
 

Definition at line 255 of file XMLOutput.hpp.

00256    {
00257       characters(str,len);
00258    }


The documentation for this class was generated from the following file:
Generated on Sat Oct 13 16:08:57 2001 for XMILL by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001