static void PrintTree (DirEntry_s *direntry, int indent) { if (!direntry) return; if (Option.print) { Indent(indent); printf("%s %s\n", direntry->type == T_DIR ? "D" : "F", direntry->name); } PrintTree(direntry->child, indent + 1); PrintTree(direntry->sibling, indent); }
void PicturePrinter::SetFontSpacing(int32 spacing) { Indent(); Print("SetFontSpacing"); switch(spacing) { case B_CHAR_SPACING: Print("B_CHAR_SPACING"); break; case B_STRING_SPACING: Print("B_STRING_SPACING"); break; case B_BITMAP_SPACING: Print("B_BITMAP_SPACING"); break; case B_FIXED_SPACING: Print("B_FIXED_SPACING"); break; default: Print("Unknown: ", (float)spacing); } Cr(); }
static TRI_aql_node_t* DumpStatementStart (TRI_aql_statement_walker_t* const walker, TRI_aql_node_t* const node) { if (node == NULL) { return node; } assert(walker); Indent((TRI_aql_dump_t*) walker->_data); return DumpNode(walker, node); }
// Update current position, printing it if it's significantly different // from the previous position. void PrintPos(IRInst* inst, unsigned int indent) { const IRPos& newPos = inst->GetPos(); if (newPos.GetFile() != mLastPos.GetFile() || newPos.GetLine() > mLastPos.GetLine() + 5 || newPos.GetLine() < mLastPos.GetLine()) { Indent(indent) << "#line " << newPos.GetLine() << " " << '"' << newPos.GetFile() << '"' << "\n"; } mLastPos = newPos; }
void MP4Integer64Property::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits, u_int32_t index) { if (m_implicit && !dumpImplicits) { return; } Indent(pFile, indent); fprintf(pFile, "%s = "U64" (0x%016"X64F")\n", m_name, m_values[index], m_values[index]); }
void XmlWriter::WriteVector(const std::vector<T>& val) { Indent(); typename std::vector<T>::const_iterator it; bool first = true; for (it = val.begin(); it != val.end(); it++) { if (!first) stream.put(' '); first = false; Write<T>(*it); } }
void SaveStart(char const* name) { if (name == 0) return; if(m_depth > 0){ this->This()->Save("\n"); Indent(); } ++m_depth; this->This()->Save("["); this->This()->Save(name); this->This()->Save("]:"); }
void AstIfStatement::PrintInternal(ostream& o, int indentation) { o << Indent(indentation) << "if ("; condition->Print(o, indentation, shared_from_this()); o << endl; trueBranch->Print(o, indentation + 1, shared_from_this()); if (falseBranch) { o << endl; falseBranch->Print(o, indentation + 1, shared_from_this()); } }
//--------------------------------------------------------- DocumentXML& DocumentXML::toParent() { assert(NodeStack.size() > 1 && "too much backtracking"); if (HasCurrentNodeSubNodes) { Indent(); Out << "</" << NodeStack.top() << ">\n"; } else Out << "/>\n"; NodeStack.pop(); HasCurrentNodeSubNodes = true; return *this; }
void ChunkHModelNode(BYTE *data, DWORD size) { W3dHModelNodeStruct *node = (W3dHModelNodeStruct *) data; int num_nodes = size / sizeof(W3dHModelNodeStruct); for (int i=0; i<num_nodes; i++) { printf("HModelNode.Name: \"%s\"\n", node->RenderObjName); fprintf(outf,"%sHModelNode.Name: \"%s\"\n", Indent(), node->RenderObjName); } }
void PicturePrinter::SetStipplePattern(pattern p) { Indent(); Print("SetStipplePattern"); if (compare(p, B_SOLID_HIGH)) Print("B_SOLID_HIGH"); else if (compare(p, B_SOLID_LOW)) Print("B_SOLID_LOW"); else if (compare(p, B_MIXED_COLORS)) Print("B_MIXED_COLORS"); else { for (int i = 0; i < 8; i++) { printf("%2.2x ", (unsigned int)p.data[i]); } } Cr(); }
void CameraRange::Process( uint32_t inStartOffset, uint32_t inEndOffset ) { if (inEndOffset != inStartOffset + 8) { throw DataLengthException( Name(), inStartOffset, inEndOffset, 8 ); } Out() << Indent() << Name() << " ( " << FetchFloat32( inStartOffset ) << " " << FetchFloat32( inStartOffset+4 ) << " )\n"; }
void CXMLExporterBase::Write(const char* lpszFormat, ...) { va_list argList; va_start(argList, lpszFormat); Indent(); // Write the data vfprintf(m_pFile, lpszFormat, argList); va_end(argList); }
void StartElement(PCWSTR name) { if(!m_isTagClosed) { m_stream << ">\r\n"; } Indent(m_stack.size()); m_stream << '<' << name; m_stack.push_back(string(name)); m_isTagClosed = false; m_hasChild = false; }
void ChunkPivot(BYTE *data, DWORD size) { W3dPivotStruct *pivot = (W3dPivotStruct *) data; int num_pivots = size / sizeof(W3dPivotStruct); for (int i=0; i<num_pivots; i++) { printf("Pivot.Name: \"%s\"\n", pivot[i].Name); fprintf(outf,"%sPivot.Name: \"%s\"\n", Indent(), pivot[i].Name); } }
FunctionLogger(const char *name, const char *fmt=NULL, ...) : mName(name) { Indent(); printf("-> %s ", name); if (fmt) { va_list args; va_start(args, fmt); vprintf(fmt, args); va_end(args); } printf("\n"); ++sIndent; }
void SystemOutputUsageFormatter::FormatArgument( const std::string& primaryName, bool hasVariableParameterCount, int maxArgumentCount, const std::vector<std::string>& aliases, const std::vector<std::string>& dependencyNames, const std::string& description ) { myUsage << std::endl << Indent() << primaryName; if( aliases.size() > 0 ) { bool firstAlias = true; myUsage << " ("; for( auto& alias : aliases ) { if( !firstAlias ) { myUsage << ", "; } firstAlias = false; myUsage << alias; } myUsage << ")"; } if( maxArgumentCount == Constructor::NO_PARAMETER_LIMIT ) { myUsage << " <arg1> ... <argN>"; } else if( hasVariableParameterCount ) { for( int i = 0; i < maxArgumentCount; ++i ) { myUsage << (i == 0 ? "" : " "); myUsage << " <arg" << (i + 1) << ">"; } } myUsage << std::endl << Indent() << Indent() << description; if( dependencyNames.size() > 0 ) { myUsage << std::endl << Indent() << Indent() << "Dependencies:"; for( size_t i = 0; i < dependencyNames.size(); ++i ) { myUsage << (i == 0 ? "" : ", " ); myUsage << dependencyNames[i]; } myUsage << std::endl; } }
ZString ValueList::GetString(int indent) { // [ args ] ZString str = "[\n"; m_iter.First(); while (!m_iter.End()) { str += Indent(indent + 1) + m_iter.Value()->GetChildString(indent + 1); m_iter.Next(); if (m_iter.End()) { str += "\n"; } else { str += ",\n"; } } return str + Indent(indent) + "]"; }
void WriteSeq(IRSeq* seq, unsigned int indent, bool noBraces) { const IRStringConst* funcName = seq->GetFuncName(); if (funcName && !noBraces) { Indent(indent) << "{"; if (funcName) mOut << " // " << funcName->Get(); mOut << "\n"; indent += 4; } const IRStmts& stmts = seq->GetStmts(); IRStmts::const_iterator it; for (it = stmts.begin(); it != stmts.end(); ++it) Write(*it, indent); if (funcName && !noBraces) { indent -= 4; Indent(indent) << "}"; if (funcName) mOut << " // " << funcName->Get(); mOut << "\n"; } }
void MP4StringProperty::Dump(FILE* pFile, u_int8_t indent, bool dumpImplicits, u_int32_t index) { if (m_implicit && !dumpImplicits) { return; } Indent(pFile, indent); if (m_useUnicode) { fprintf(pFile, "%s = %ls\n", m_name, (wchar_t*)m_values[index]); } else { fprintf(pFile, "%s = %s\n", m_name, m_values[index]); } }
HRESULT PrintingContentHandler::endElement( /* [in] */ const wchar_t *pwchNamespaceUri, /* [in] */ int cchNamespaceUri, /* [in] */ const wchar_t *pwchLocalName, /* [in] */ int cchLocalName, /* [in] */ const wchar_t *pwchQName, /* [in] */ int cchQName) { mIndent -= 4; Indent(); printf( "end element \"%.*ls\"\n", cchLocalName, pwchLocalName ); return S_OK; }
/// <summary>Called for each occurrence of parameterless macros</summary> /// <param name="match">The match.</param> /// <param name="depth">Debugging output depth</param> /// <returns>Replacement text</returns> wstring DescriptionParser::onMatchKeyword(const wsmatch& match, int depth) const { const DescriptionMacro* m; wstring name = (match[1].matched ? match[1].str() : match[2].str()); // Retrieve keyword/macro // Lookup macro + recursively parse if (DescriptionLib.Macros.TryFind(name, m)) { #ifdef PRINT_CONSOLE Console << Cons::Cyan << Indent(depth) << "Matched Keyword: " << Cons::Yellow << match[0].str() << Cons::White << " with " << Cons::Yellow << m->Text << ENDL; #endif return m->Recursive ? Parse(m->Text, depth+1) : m->Text; } #ifdef PRINT_CONSOLE Console << Cons::Red << Indent(depth) << "Ignored Keyword: " << Cons::White << match[0].str() << ENDL; #endif // Failed: Return match return match[0].str(); }
void TriMesh::WriteBoundingBox( uint32_t inStartOffset ) { float xMin = FetchFloat32( inStartOffset ); float yMin = FetchFloat32( inStartOffset+4 ); float zMin = FetchFloat32( inStartOffset+8 ); float xMax = FetchFloat32( inStartOffset+12 ); float yMax = FetchFloat32( inStartOffset+16 ); float zMax = FetchFloat32( inStartOffset+20 ); uint32_t emptyFlag = FetchUInt32( inStartOffset+24 ); Out() << Indent(1) << xMin << ' ' << yMin << ' ' << zMin << ' ' << xMax << ' ' << yMax << ' ' << zMax << ' ' << ((emptyFlag == 0)? "False" : "True") << "\t# bounding box\n"; }
void StartSegment (const char* Name, unsigned AddrSize) /* Start a segment */ { if (Pass == PassCount) { Output (".segment"); Indent (ACol); if (AddrSize == ADDR_SIZE_DEFAULT) { Output ("\"%s\"", Name); } else { Output ("\"%s\": %s", Name, AddrSizeToStr (AddrSize)); } LineFeed (); } }
void PicturePrinter::SetFontFace(int32 flags) { Indent(); Print("SetFontFace"); int32 f = 0; if (flags == 0) Print("none set"); PRINT_FLAG(B_REGULAR_FACE); PRINT_FLAG(B_BOLD_FACE); PRINT_FLAG(B_ITALIC_FACE); PRINT_FLAG(B_NEGATIVE_FACE); PRINT_FLAG(B_OUTLINED_FACE); PRINT_FLAG(B_UNDERSCORE_FACE); PRINT_FLAG(B_STRIKEOUT_FACE); if (flags != f) printf("Unknown Additional Flags %" B_PRId32 "", flags & ~f); Cr(); }
STATIC_ROUTINE int MultiStatement( int nstmt, struct descriptor_r *pin[], struct descriptor_d *pout) { int status = 1, j; if (nstmt == 0) { status = Append(";", pout); if (status&1) status = Indent(0, pout); } else for (j = 0; j < nstmt && status&1; j++) status = OneStatement(pin[j], pout); return status; }
HRESULT PrintingContentHandler::startElement( /* [in] */ const wchar_t *pwchNamespaceUri, /* [in] */ int cchNamespaceUri, /* [in] */ const wchar_t *pwchLocalName, /* [in] */ int cchLocalName, /* [in] */ const wchar_t *pwchQName, /* [in] */ int cchQName, /* [in] */ ISAXAttributes *pAttributes) { Indent(); printf( "start element \"%.*ls\"\n", cchLocalName, pwchLocalName ); mIndent += 4; return S_OK; }
// Print a vector a sequence of JSON values, comma separated, wrapped in "[]". template<typename T> void PrintVector(const Vector<T> &v, Type type, int indent, const IDLOptions &opts, std::string *_text) { std::string &text = *_text; text += "["; text += NewLine(opts); for (uoffset_t i = 0; i < v.size(); i++) { if (i) { text += ","; text += NewLine(opts); } text.append(indent + Indent(opts), ' '); if (IsStruct(type)) Print(v.GetStructFromOffset(i * type.struct_def->bytesize), type, indent + Indent(opts), nullptr, opts, _text); else Print(v[i], type, indent + Indent(opts), nullptr, opts, _text); } text += NewLine(opts); text.append(indent, ' '); text += "]"; }
void avtMaterialMetaData::Print(ostream &out, int indent) const { avtBaseVarMetaData::Print(out, indent); Indent(out, indent); out << "Materials names:" << endl; Indent(out, indent+1); for (size_t i = 0; i < materialNames.size() ; ++i) { out << "\"" << materialNames[i].c_str() << "\""; if (colorNames.size()) { if (colorNames[i] != "") out << "(color=\"" << colorNames[i].c_str() << "\")"; if (i < materialNames.size() - 1) out << ", "; if((i+1)%3 == 0) { out << endl; Indent(out, indent+1); } } else { if (i < materialNames.size() - 1) out << ", "; if((i+1)%6 == 0) { out << endl; Indent(out, indent+1); } } } out << endl; }
bool SmartIndentCpp::BraceIndent(cbStyledTextCtrl *stc, wxString &indent)const { if ( BraceSmartIndentEnabled() ) { int style = 0; if (stc->GetLexer() == wxSCI_LEX_CPP) style = wxSCI_C_STRING; else // wxSCI_LEX_D style = wxSCI_D_STRING; int brace_position = GetFirstBraceInLine(stc, style); return Indent(stc, indent, brace_position); } return false; }