// static std::string LLPanelDirBrowser::filterShortWords( const std::string source_string, int shortest_word_length, bool& was_filtered ) { // degenerate case if ( source_string.length() < 1 ) return ""; std::stringstream codec( source_string ); std::string each_word; std::vector< std::string > all_words; while( codec >> each_word ) all_words.push_back( each_word ); std::ostringstream dest_string( "" ); was_filtered = false; std::vector< std::string >::iterator iter = all_words.begin(); while( iter != all_words.end() ) { if ( (int)(*iter).length() >= shortest_word_length ) { dest_string << *iter; dest_string << " "; } else { was_filtered = true; } ++iter; }; return dest_string.str(); }
void Surface_saveBmp(StiGame::Surface *surface, char* dest, int length) { std::string dest_string (dest, length); surface->saveBmp(dest_string); }