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

krmuo::Converter Class Reference

object for converting strings More...

#include <muo_convert.h>

Inheritance diagram for krmuo::Converter:

Inheritance graph
[legend]
Collaboration diagram for krmuo::Converter:

Collaboration graph
[legend]
List of all members.

Public Methods

 Converter ()
 general constructor for any type of Converter

virtual ~Converter ()
 class-destructor

const string decode (const string &pUnDecodedString)
 realize a (default) decodation (valid for xml and html)

const string encode (const string &pUnEncodedString)
 realize a (default) encodation (valid for xml and html)


Protected Attributes

string::const_iterator mUnConvertedStringIterator
 start for the next get-token-method

string::const_iterator mUnConvertedStringEnd
 start for the next get-token-method

string mUnConvertedToken
 the last unconverted token

string mConvertedToken
 the last converted token

string mConvertedString
 the result of the conversion

char mUtf8Sign [20]
 buffer for generating an utfString

string mUtf8String
 ... and the corresponding string itself

krmuo::CodeTokenMapmTokenMap
 pointer the valid codeTokenMap


Detailed Description

object for converting strings

Converter are XmlConverter, UrlConverter, HtmlConverter

Note: Html- and xml-encodation uses the same tag-structure namely &...; Therefore the only difference between an thml- and and xml-converter concernes the set of tokens being fixed in the codeTokenMap. => The default-implementation of a converter is valid vor an xml-converter and an html-converter. The difference is realized by setting the pointer mTokenMap to the correct codeTokenMap - the htmlCodeTokenMap or the xmlCodeTokenMap - which are made as member by the constructors of the real converters

Definition at line 65 of file muo_convert.h.


Constructor & Destructor Documentation

krmuo::Converter::Converter  
 

general constructor for any type of Converter

intializes all member variables

Definition at line 48 of file muo_convert.cc.

References mUtf8Sign.


Member Function Documentation

const string krmuo::Converter::decode const string &    pUnDecodedString
 

realize a (default) decodation (valid for xml and html)

Parameters:
pUnDecodedString  :- a row of undecoded entities
Returns :
a copy(!) of the internal result string
while any undecoded entity can be found decoded that entity and append the result ( normally a one-sign-string ) to the internal result string of the conversion

Reimplemented in krmuo::UrlConverter.

Definition at line 80 of file muo_convert.cc.

References krmuo::CodeTokenMap::decodeToken(), krmuo::CodeTokenMap::isDecodableToken(), mConvertedString, mTokenMap, mUnConvertedStringEnd, mUnConvertedStringIterator, and mUnConvertedToken.

const string krmuo::Converter::encode const string &    pUnEncodedString
 

realize a (default) encodation (valid for xml and html)

Parameters:
pUnEncodedString  :- a row of unencoded signs
Returns :
copy(!) of the internal result string
while any undecoded signs can be found encoded that sign and append the result (= entity(!)) to the internal result string of the conversion

Reimplemented in krmuo::UrlConverter.

Definition at line 109 of file muo_convert.cc.

References krmuo::CodeTokenMap::encodeSign(), krmuo::CodeTokenMap::isEncodableSign(), mConvertedString, mTokenMap, mUnConvertedStringIterator, and mUtf8String.

Referenced by mrprj::Task::printTaskAsHtmlSurveyMember(), mrprj::Task::printTaskAsLeafYankTodoMember(), mrprj::Task::printTaskAsMrPrjXmlFileMember(), mrprj::Task::printTaskAsTreeYankTodoMember(), and mrprj::TaskField::printTaskFieldAsMrPrjXmlFile().


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 10:58:38 2003 for MRPROJEXT by doxygen1.2.17