void Node::WriteClosingTag (std::ostream & out, unsigned indent) const { if (!_closed) { out << Indentation (indent) << "</" << _name << '>' << std::endl; } }
Emitter& Emitter::Write(const _Comment& comment) { if(!good()) return *this; m_stream << Indentation(m_pState->GetPreCommentIndent()); Utils::WriteComment(m_stream, comment.content, m_pState->GetPostCommentIndent()); return *this; }
void CAutoplayerTrace::Add(CString symbol, double value) { ENT write_log(preferences.debug_auto_trace(), "[CAutoplayerTrace] Add (%s, %.3f)\n", symbol, value); if (!SymbolNeedsToBeLogged(symbol)) return; CString new_message; if (COHScriptObject::IsFunction(symbol) || COHScriptObject::IsOpenPPLSymbol(symbol)) { // Function with known value a priori new_message.Format("%s%s = %.3f [cached]", Indentation(), symbol, value); } else { // "Normal" symbol new_message.Format("%s%s = %.3f", Indentation(), symbol, value); } _symboltrace_collection.Add(new_message); _already_logged_symbols[symbol] = true; _number_of_log_lines++; }
Emitter& Emitter::Write(const _Comment& comment) { if(!good()) return *this; if(m_stream.col() > 0) m_stream << Indentation(m_pState->GetPreCommentIndent()); Utils::WriteComment(m_stream, comment.content, m_pState->GetPostCommentIndent()); m_pState->RequireHardSeparation(); m_pState->ForceHardSeparation(); return *this; }
Emitter& Emitter::Write(const _Comment& comment) { if (!good()) return *this; PrepareNode(EmitterNodeType::None); if (m_stream.col() > 0) m_stream << Indentation(m_pState->GetPreCommentIndent()); Utils::WriteComment(m_stream, comment.content, m_pState->GetPostCommentIndent()); m_pState->SetNonContent(); return *this; }
void Node::WriteOpeningTag (std::ostream & out, unsigned indent) const { out << Indentation (indent) << "<" << _name; for (ConstAttribIter it = FirstAttrib (); it != LastAttrib (); ++it) { out << " " << (*it)->GetName () << "=\"" << (*it)->GetValue () << "\""; } if (_closed) { out << "/>" << std::endl; } else { out << ">" << std::endl; } }
int CAutoplayerTrace::Add(CString symbol) { ENT write_log(preferences.debug_auto_trace(), "[CAutoplayerTrace] Add (%s, ...)\n", symbol); // This function for symbols without value is for functions only. // These functions are eitherpredefined (f$), userdefined (f$) // or OpenPPL (upper-cases). // The value will be backpatched later. assert(COHScriptObject::IsFunction(symbol) || COHScriptObject::IsOpenPPLSymbol(symbol)); CString new_message; new_message.Format("%s%s = ", Indentation(), symbol); _symboltrace_collection.Add(new_message); // Nothing to do for _already_logged_symbols here, // as this Add()-function is for the first-time-evaluation // of f$functions. _number_of_log_lines++; return (_number_of_log_lines - 1); }
void Node::Write (std::ostream & out, unsigned indent) const { WriteOpeningTag (out, indent); if (!_closed) { for (ConstChildIter it = FirstChild (); it != LastChild (); ++it) { XML::Node * child = *it; if (child->GetName ().empty ()) // text { out << Indentation (indent) << child->GetAttribValue ("Text") << std::endl; } else { child->Write (out, indent + 2); } } } WriteClosingTag (out, indent); }