tCharacterFilter Class Reference

List of all members.

Public Member Functions

 tCharacterFilter ()
char Filter (unsigned char in)

Private Member Functions

void SetMap (int in1, int in2, unsigned char out)
void SetMap (unsigned char in, unsigned char out)

Private Attributes

char filter [256]


Detailed Description

Definition at line 228 of file tString.cpp.


Constructor & Destructor Documentation

tCharacterFilter::tCharacterFilter (  )  [inline]

map umlauts and stuff to their base characters

todo: map weird chars

Definition at line 231 of file tString.cpp.

References filter, and SetMap().

00232     {
00233         int i;
00234         filter[0]=0;
00235 
00236         // map all unknown characters to underscores
00237         for (i=255; i>=0; --i)
00238         {
00239             filter[i] = '_';
00240         }
00241 
00242         // leave ASCII characters as they are
00243         // for (i=127; i>=32; --i)
00244         // no, leave all ISO Latin 1 characters as they are
00245         for (i=255; i>=32; --i)
00246         {
00247             filter[i] = i;
00248         }
00249 
00250         // map return and tab to space
00251         SetMap('\n',' ');
00252         SetMap('\t',' ');
00253 
00255         /*
00256         SetMap(0xc0,0xc5,'A');
00257         SetMap(0xd1,0xd6,'O');
00258         SetMap(0xd9,0xdD,'U');
00259         SetMap(0xdf,'s');
00260         SetMap(0xe0,0xe5,'a');
00261         SetMap(0xe8,0xeb,'e');
00262         SetMap(0xec,0xef,'i');
00263         SetMap(0xf0,0xf6,'o');
00264         SetMap(0xf9,0xfc,'u');
00265         */
00266 
00268         // make this data driven.
00269     }

Here is the call graph for this function:


Member Function Documentation

char tCharacterFilter::Filter ( unsigned char  in  )  [inline]

Definition at line 271 of file tString.cpp.

References filter.

Referenced by tString::NetFilter().

00272     {
00273         return filter[ static_cast< unsigned int >( in )];
00274     }

Here is the caller graph for this function:

void tCharacterFilter::SetMap ( int  in1,
int  in2,
unsigned char  out 
) [inline, private]

Definition at line 276 of file tString.cpp.

References filter, and tASSERT.

Referenced by tCharacterFilter().

00277     {
00278         tASSERT( in2 <= 0xff );
00279         tASSERT( 0 <= in1 );
00280         tASSERT( in1 < in2 );
00281         for( int i = in2; i >= in1; --i )
00282             filter[ i ] = out;
00283     }

Here is the caller graph for this function:

void tCharacterFilter::SetMap ( unsigned char  in,
unsigned char  out 
) [inline, private]

Definition at line 285 of file tString.cpp.

References filter.

00286     {
00287         filter[ static_cast< unsigned int >( in ) ] = out;
00288     }


Member Data Documentation

char tCharacterFilter::filter[256] [private]

Definition at line 290 of file tString.cpp.

Referenced by Filter(), SetMap(), and tCharacterFilter().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:55:02 2008 for Armagetron Advanced by  doxygen 1.5.4