string_filter.h

Go to the documentation of this file.
00001 class string_filter_noncasesensitive {
00002 public:
00003         string_filter_noncasesensitive(const char * p_string,t_size p_string_len = infinite) {
00004                 uStringLower(m_pattern,p_string,p_string_len);
00005         }
00006 
00007         bool test(const char * p_string,t_size p_string_len = infinite) const {
00008 		::uStringLower(m_lowercasebuffer,p_string,p_string_len);
00009                 t_size walk = 0;
00010                 while(m_pattern[walk] != 0) {
00011                         while(m_pattern[walk] == ' ') walk++;
00012                         t_size delta = 0;
00013                         while(m_pattern[walk+delta] != 0 && m_pattern[walk+delta] != ' ') delta++;
00014                         if (delta > 0) {
00015                                 if (pfc::string_find_first_ex(m_lowercasebuffer,infinite,m_pattern+walk,delta) == infinite) return false;
00016                         }
00017                         walk += delta;
00018                 }
00019                 return true;
00020         }
00021 private:
00022         mutable pfc::string8_fastalloc m_lowercasebuffer;
00023         pfc::string8 m_pattern;
00024 };

Generated on Fri Apr 25 18:49:33 2008 for foobar2000 SDK by  doxygen 1.5.5