예제 #1
0
std::string XmlNode::toXml() const
{
    std::ostringstream ss;
    appendContents(ss);

    return ss.str();
}
예제 #2
0
void DmxPrintOutput::appendNewLine ()
{
#ifdef PRINT_TO_VIDEO 
    char	*contents = "=========== NewLine ==========\n";
#else
    char	*contents = "\n";
#endif
    appendContents((XtPointer) this, contents);
}
예제 #3
0
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
}