void ossimKeywordlist::writeToStream(std::ostream& out) const { KeywordMap::const_iterator i; ossimString value; for(i = m_map.begin(); i != m_map.end(); ++i) { value = (*i).second; value = value.substitute('\n', "\\\n", true); out << (*i).first << delimiter_str().c_str() << " " << value << std::endl; } }
//******************************************************************* // Public Method: //******************************************************************* std::ostream& ossimKeywordlist::print(std::ostream& os) const { writeToStream(os); #if 0 KeywordMap::const_iterator i; for(i = m_map.begin(); i != m_map.end(); ++i) { os << (*i).first << delimiter_str().c_str() << " " << (*i).second << std::endl; } #endif return os; }
void ossimKeywordlist::toString(ossimString& result)const { std::ostringstream out; writeToStream(out); result = out.str(); #if 0 KeywordMap::const_iterator i; for(i = m_map.begin(); i != m_map.end(); i++) { result += (*i).first; result += delimiter_str().c_str(); result += " "; result += (*i).second; result += '\n'; } #endif }
void ossimKeywordlist::writeToStream(std::ostream& out) const { KeywordMap::const_iterator i; ossimString value; ossimRegExp reg("\n|\r| $|^ "); for(i = m_map.begin(); i != m_map.end(); ++i) { value = (*i).second; if(!value.empty()) { if(reg.find(value)) { value = "\"\"\"" + value + "\"\"\""; } } // value = value.substitute('\n', "\\\n", true); out << (*i).first << delimiter_str().c_str() << " " << value << std::endl; } }