Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/old_18mar_diff/Str14dec/StrFind.inl

Go to the documentation of this file.
00001 #ifndef __J2K__JString_Find_INL__
00002 #define __J2K__JString_Find_INL__
00003 
00004 #include <j2k/Fred/String/String.hpp>
00005 #include <string.h>
00006 #include <time.h>
00007 
00008 // Does NOT use external JString function
00009 
00010 // Instr missing (FindAt)
00011 
00012 inline long JString::Find( const JString& S ) const
00013 {
00014   return Find( S.parseString(), 0 );
00015 }
00016 
00017 inline long JString::Find( const JString& S, ULONG sz ) const
00018 {
00019   return Find( S.parseString(), sz );
00020 }
00021 
00022 inline long JString::Find( char ch ) const {
00023   // find first single character
00024   // return -1 if not found and index otherwise
00025   for( ULONG l = 0; l < pData->length; l++ ) {
00026     if ( pData->data[l] == ch ) return l;
00027   }
00028   return (-1);
00029 }
00030 
00031 inline long JString::ReverseFind( char ch ) const {
00032   // find last single character
00033   // return -1 if not found and index otherwise
00034 
00035   for( ULONG l = (pData->length - 1); l >= 0; l-- ) {
00036     if ( pData->data[l] == ch ) return ( pData->length - l - 1 );
00037   }
00038   return (-1);
00039 }
00040 
00041 inline long JString::Find( const char* s ) const {
00042   return Find( s, 0 );
00043 }
00044 
00045 inline JString  JString::getFind( const char* s ) {
00046   return getFind( s, 0 );
00047 }
00048  
00049 #endif

Generated on Sun Oct 14 18:46:28 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001