#include <GlobalDefinitions.h>
Public Member Functions | |
| MakeIntoWord (int bitsPerSymbol, const char *tt) | |
| Word | operator() (const string &s) |
Protected Attributes | |
| int | bitsPerSymbol_ |
| const char * | tt_ |
| map< char, Word > | map_ |
Definition at line 640 of file GlobalDefinitions.h.
| MakeIntoWord::MakeIntoWord | ( | int | bitsPerSymbol, | |
| const char * | tt | |||
| ) |
Definition at line 119 of file GlobalDefinitions.cpp.
References bitsPerSymbol_, and map_.
00119 : 00120 bitsPerSymbol_( bitsPerSymbol ), tt_( tt ) 00121 { 00122 for ( unsigned int i(0) ; i < (1<<bitsPerSymbol_) ; ++i ) 00123 { 00124 map_.insert( make_pair( (static_cast<char>(tolower(tt[i]))),i ) ); 00125 map_.insert( make_pair( (static_cast<char>(toupper(tt[i]))),i ) ); 00126 }; 00127 } // ~MakeIntoWord::MakeIntoWord( int bitsPerSymbol, const char* tt )
| Word MakeIntoWord::operator() | ( | const string & | s | ) |
Definition at line 144 of file GlobalDefinitions.cpp.
References bitsPerSymbol_, and map_.
00145 { 00146 Word w(0); 00147 if ( s.size()*bitsPerSymbol_ > (8*sizeof(Word)) ) return w; 00148 for ( unsigned int i(0) ; i < s.size() ; i++ ) 00149 { 00150 w <<= bitsPerSymbol_; 00151 if (map_.find(s[i]) == map_.end() ) { w=0; break; } 00152 else w |= map_[s[i]]; 00153 } // ~for 00154 return w; 00155 00156 } // ~Word MakeIntoWord::operator()( const string& s )
int MakeIntoWord::bitsPerSymbol_ [protected] |
const char* MakeIntoWord::tt_ [protected] |
Definition at line 649 of file GlobalDefinitions.h.
map< char, Word > MakeIntoWord::map_ [protected] |
1.5.2