std::string Value::getComment( CommentPlacement placement ) const { if ( hasComment(placement) ) return comments_[placement].comment_; return ""; }
DOMNode* Workspace<EncodingT>::saveXML(DOMDocument* xml_doc) const { DOMElement* xml_wrks = NULL; DOMNode* xml_comment = NULL; DOMText* xml_text = NULL; try { xml_wrks = xml_doc->createElement( AX("Workspace") ); xml_wrks->setAttribute( AX("Name"), CX(m_name) ); xml_wrks->setAttribute( AX("Author"), CX(m_author) ); xml_wrks->setAttribute( AX("Brief"), CX(m_brief) ); xml_wrks->setAttribute( AX("Version"), CX(m_version) ); xml_wrks->setAttribute( AX("Type"), (m_type==WRK_FILE)?AX("File"):AX("Project") ); xml_wrks->setAttribute( AX("Option"), AX(ToString::parse(m_option))); if (hasComment()) { xml_comment = xml_doc->createElement( AX("Comments") ); xml_wrks->appendChild(xml_comment); xml_text = xml_doc->createTextNode( CX(m_comment) ); xml_comment->appendChild(xml_text); } for (const_file_iterator ite = beginFiles(); ite != endFiles(); ++ite) { xml_wrks->appendChild(ite->saveXML(xml_doc)); } m_logger->debug("Workspace::saveXML() : XML workspace saved"); } catch ( const DOMException& e ) { m_logger->fatalStream() << "Workspace::saveXML() : XML workspace save error: " << A(e.getMessage()); //throw e; } return xml_wrks; }
JSONCPP_STRING Value::getComment(CommentPlacement placement) const { if (hasComment(placement)) return comments_[placement].comment_; return ""; }