summaryrefslogtreecommitdiff
path: root/include/tools/ixml.h
blob: 737c753a465de5394103b13a920c012c6a31571b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * ixml.h
 *
 *  Created on: 03.10.2012
 *      Author: savop
 */

#ifndef IXML_H_
#define IXML_H_

#include <string>
#include <upnp/upnp.h>
#include "../tools.h"

using namespace std;

namespace upnp {

namespace ixml {

  void XmlEscapeSpecialChars(string& doc);
  /**
   * First occurance of item
   *
   * Finds the first occurance of a specified item in a given \bc IXML document and returns its value.
   * If an error occures, its code is stored in the last parameter \c 'error'.
   *
   * @return error the error code in case of an error
   * @param doc the \c IXML document to be parsed
   * @param item the item which shall be found
   * @param the value of the item
   */
  int IxmlGetFirstDocumentItem( IN IXML_Document * doc, IN const string item, string& value );
  /**
   * Adds a property
   *
   * This adds a UPnP property to an \bc IXML document.
   * The property must have the pattern "namespace:property@attribute".
   *
   * @return returns
   * - \bc NULL, in case of an error
   * - \bc the newly created property node or the node at which the attribute was
   *       appended to
   * @param document the \c IXML document to put the parameter in
   * @param node the specific node where to put the parameter
   * @param upnpproperty the upnp property
   * @param value the value of the upnp property
   */
  IXML_Element* IxmlAddProperty(IN IXML_Document* document, IN IXML_Element* node, IN const string& upnpproperty, IN const string& value );

  IXML_Element* IxmlAddFilteredProperty(IN const StringList& Filter, IN IXML_Document* document, IN IXML_Element* node, IN const string& upnpproperty, IN const string& value );

  IXML_Element* IxmlReplaceProperty(IN IXML_Document* document, IN IXML_Element* node, IN const string& upnpproperty, IN const string& newValue );
}

}


#endif /* IXML_H_ */