Generated on Tue Dec 16 12:49:16 2008 for BIU-2.2.0 by doxygen 1.5.1

src/biu/util/biu-string.cpp

Go to the documentation of this file.
00001 
00002 #include "biu/util/biu-string.h"
00003 #include <iostream>
00004 
00005 namespace biu {
00006   namespace util {
00007     
00008     //-------------------------------------------------------------------------------
00009     // search in a target all occurrences of query
00010     // @author Michael Hiller, Sebastian Will (leichte Ă„nderungen)
00011     //-------------------------------------------------------------------------------
00012     bool findQueryString(std::string target, std::string query,std::ostream & out) {
00013        std::string::size_type loc=0;
00014        bool found=false;
00015        
00016        while ( (loc=target.find( query, loc )) != std::string::npos ) {
00017            out <<"query: " <<query <<" found at " <<loc <<std::endl;
00018            found=true;
00019            loc++;
00020        }
00021        
00022        if (!found) {
00023            out <<"query: " <<query <<" not found" <<std::endl;
00024        }
00025        
00026        return found;
00027     }
00028 
00029   } // namespace util   
00030 }  // namespace biu