common.cc

Go to the documentation of this file.
00001 
00002 /*! \file 
00003         \brief Implementations of standard functions for md tree.
00004         \author jaz
00005 */
00006 
00007 #include <lestes/md/common.hh>
00008 #include <sstream>
00009 
00010 package(lestes);
00011 package(md);
00012 
00013 initialize_top_logger(md_logger, "md" );
00014 
00015 /*!
00016         Replaces substring in a string.
00017         
00018         \param str The string where replacement is performed.
00019         \param replaced_string The replaced string.
00020         \param replacement The replacement.
00021 */
00022 lstring string_replace(lstring str, lstring replaced_string, lstring replacement) {
00023         lstring::size_type replaced_size = replaced_string.length();
00024         lstring::size_type i = 0;
00025         while( (i=str.find(replaced_string,i))!=lstring::npos) {
00026                 str = str.replace(i, replaced_size, replacement);
00027         }
00028         return str;
00029 }
00030 
00031 end_package(md);
00032 end_package(lestes);

Generated on Mon Feb 12 18:22:32 2007 for lestes by doxygen 1.5.1-20070107