std::string XmlNode::toXml() const { std::ostringstream ss; appendContents(ss); return ss.str(); }
void DmxPrintOutput::appendNewLine () { #ifdef PRINT_TO_VIDEO char *contents = "=========== NewLine ==========\n"; #else char *contents = "\n"; #endif appendContents((XtPointer) this, contents); }
void DmxPrintOutput::appendPageBreak () { char * buf; char *contents = "\n"; int nlines, missing; nlines = getNumLines(); missing = ((nlines % _lines_per_page) > 0) ? (_lines_per_page - (nlines % _lines_per_page)) : 0; if (! missing) return; #ifdef PRINT_TO_VIDEO for (int i=0; i<missing; i++) { char buffer[128]; sprintf(buffer, "Page Break Line: %d\n", i); appendContents((XtPointer) this, buffer); } fprintf( stdout, "Total Lines: %d; Lines Per Page: %d; Missing Lines: %d\n", nlines, _lines_per_page, missing); #else buf = (char *) malloc((missing * 2) + 1); for (int i=0; i<missing; i++) strcat(buf, contents); appendContents(this, contents); free(buf); #endif }