1 #include "bbtkUtilities.h"
7 //========================================================================
8 /// Usefull functions for html generation
9 static void replace( std::string& str,
10 const std::string& from, const std::string& to )
13 string::size_type pos = str.find( from );
14 while ( pos != string::npos )
16 // std::cout << "'" << str << "' -> '";
17 str.replace( pos, from.size(), to );
18 pos = str.find( from, pos+from.size()-1 );
19 // std::cout << str << "'"<< std::endl;
22 //==========================================================================
23 inline void html_format(std::string& str)
25 replace( str, "&", "&" );
26 replace( str, "<", "<"# );
27 replace( str, ">", ">" );