Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

parsers/parser.cpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 //---------------------------------------------------------------------------
00007 
00008 //---------------------------------------------------------------------------
00009 // Application includes
00010 #include "parser.hpp"
00011 //---------------------------------------------------------------------------
00012 
00013 
00014 
00015 
00016 //---------------------------------------------------------------------------
00017 bool OctaneParser::IsNonWordCharacter(unsigned char c)
00018 {
00019         // return true if c is a non-word character, ie a delimiter between words
00020         // ATTN: this is a pretty inefficient function; we could use a static lookup table if we wanted to do this fast
00021         if (c==39)
00022                 {
00023                 // apostrophe
00024                 return false;
00025                 }
00026         else if (c<48)
00027                 {
00028                 // punctuation and nonprintables
00029                 return true;
00030                 }
00031         else if (c<58)
00032                 {
00033                 // digits
00034                 return false;
00035                 }
00036         else if (c<65)
00037                 {
00038                 // punctuation
00039                 return true;
00040                 }
00041         else if (c<91)
00042                 {
00043                 // uppercase
00044                 return false;
00045                 }
00046         else if (c<97)
00047                 {
00048                 // punctuation
00049                 return true;
00050                 }
00051         else if (c<123)
00052                 {
00053                 // lowercase
00054                 return false;
00055                 }
00056         else if (c<154)
00057                 {
00058                 // punctuation and nonprintables
00059                 return true;
00060                 }
00061         else
00062                 {
00063                 // ATTN: we've got some non-english characters here which mind form characters in other languages
00064                 // for now we treat as word separators
00065                 return true;
00066                 }
00067 }
00068 //---------------------------------------------------------------------------
00069 
00070 
00071 
 
Generated on 20 May 2004 by doxygen 1.3.3