Logo Search packages:      
Sourcecode: inkscape version File versions

DOMString Pedro::XmppConfig::toXmlBuffer (  )  [virtual]

Ouputs this object as a string formatted in XML

Definition at line 171 of file pedroconfig.cpp.

References Pedro::XmppAccount::getHost(), Pedro::XmppAccount::getName(), Pedro::XmppAccount::getPassword(), Pedro::XmppAccount::getPort(), and Pedro::XmppAccount::getUsername().

Referenced by writeFile().

{

    DOMString buf;

    char fmtbuf[32];

    buf.append("<pedro>\n");
    buf.append("    <muc>\n");
    buf.append("        <group>");
    buf.append(mucGroup);
    buf.append("</group>\n");
    buf.append("        <host>");
    buf.append(mucHost);
    buf.append("</host>\n");
    buf.append("        <nick>");
    buf.append(mucNick);
    buf.append("</nick>\n");
    buf.append("        <password>");
    buf.append(mucPassword);
    buf.append("</password>\n");
    buf.append("    </muc>\n");

    for (unsigned int i = 0 ; i<accounts.size() ; i++)
        {
        XmppAccount acc = accounts[i];
        buf.append("    <account>\n");
        buf.append("        <name>");
        buf.append(acc.getName());
        buf.append("</name>\n");
        buf.append("        <host>");
        buf.append(acc.getHost());
        buf.append("</host>\n");
        buf.append("        <port>");
        snprintf(fmtbuf, 31, "%d", acc.getPort());
        buf.append(fmtbuf);
        buf.append("</port>\n");
        buf.append("        <username>");
        buf.append(acc.getUsername());
        buf.append("</username>\n");
        buf.append("        <password>");
        buf.append(acc.getPassword());
        buf.append("</password>\n");
        buf.append("    </account>\n");
        }

    buf.append("</pedro>\n");

    return buf;
}


Generated by  Doxygen 1.6.0   Back to index