std::string tostr(int level) const;
std::string cXMLElement::tostr(int depth) const{std::stringstream os;int i;for (i = 0; i < depth; i++)os << " ";os << "<" << getTagName();cXMLAttributeMap map = getAttributes();for (cXMLAttributeMap::iterator it = map.begin(); it != map.end(); ++it)os << " " << it->first << "=\"" << it->second << "\"";if (!*getNodeValue() && !getFirstChild()) {os << "/>\n";return os.str();}os << ">";os << getNodeValue();if (!getFirstChild()) {os << "</" << getTagName() << ">\n";return os.str();}os << "\n";for (cXMLElement *child = getFirstChild(); child; child = child->getNextSibling())os << child->tostr(depth + 1);for (i = 0; i < depth; i++)os << " ";os << "</" << getTagName() << ">\n";return os.str();}
/*** Returns a one-line description of the element.*/virtual std::string str() const override;//internal : Added by Adilstd::string tostr(int level) const;
~/veins-4.5/sumo-launchd.py -vv -c ~/sumo-0.29.0/sumo
You can replace tostr by print
void cXMLElement::print(std::ostream& os, int indentLevel)
std::ostream os;
elem-> print(os, 0);
std::stringstream ss;
ss << os.rdbuf();
std::string str = ss.srt();
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.