Logo Search packages:      
Sourcecode: earth3d version File versions  Download package

void ConnectNetworkService::parseDocument ( int  countParts,
struct part_t *  parts,
char *  sender 
) [private]

Parse and answer the received document

Definition at line 29 of file connectNetworkService.cpp.

Referenced by run().

  /* create DOM structure */
  QDomDocument doc;
  QString error;
  int errorLine, errorColumn;
  QString document = QCString(parts[0].content, parts[0].size+1);
  printf("Document: \"%s\"\n", document.latin1());
  if (doc.setContent(document, true, &error, &errorLine, &errorColumn)) {
    QDomNode n = doc.documentElement();
    if (n.isElement() && n.toElement().tagName() != QString("response")) {
      fprintf(stderr,"document of the wrong type (%s), root node != response\n", n.toElement().tagName().latin1());

    int msgid = n.toElement().attribute("msgid", "0").toInt();

    QString output;
    QTextStream ts(&output, IO_WriteOnly);
    ts << n;

    forwardMessage((const char *) output.latin1(), msgid, sender, countParts, parts);
  else {
    printf("XML Error \"%s\" in line %i at column %i\n", error.latin1(), errorLine, errorColumn);

Generated by  Doxygen 1.6.0   Back to index