~ubuntu-branches/ubuntu/precise/me-tv/precise-proposed

« back to all changes in this revision

Viewing changes to src/xml.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lamothe
  • Date: 2008-02-12 21:56:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080212215659-g3u4v9iz8wzxu2cd
Tags: 0.5.17-1
New upstream release (Closes: #464922)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2007 Michael Lamothe
 
2
 * Copyright (C) 2008 Michael Lamothe
 
3
 *
 
4
 * This file is part of Me TV
3
5
 *
4
6
 * This program is free software; you can redistribute it and/or modify
5
7
 * it under the terms of the GNU General Public License as published by
39
41
        XmlNode(const XmlNode& n);
40
42
        XmlNode(xmlNodePtr node);
41
43
        
42
 
        xmlNodePtr create_child_node(const Glib::ustring& name);
 
44
        xmlNodePtr create_child_node(const String& name);
43
45
        XmlNode& operator=(xmlNodePtr n);
44
46
 
45
 
        Glib::ustring get_attribute_value(const Glib::ustring& name) const;
46
 
        int get_int_attribute_value(const Glib::ustring& name) const;
 
47
        String get_attribute_value(const String& name) const;
 
48
        int get_int_attribute_value(const String& name) const;
47
49
        
48
 
        void set_content(const Glib::ustring& content, gboolean encode = true);
49
 
        void set_attribute(const Glib::ustring& name, const Glib::ustring& value);
50
 
        void set_attribute(const Glib::ustring& name, int value);
51
 
        void set_attribute(const Glib::ustring& name);
 
50
        void set_content(const String& content, gboolean encode = true);
 
51
        void set_attribute(const String& name, const String& value);
 
52
        void set_attribute(const String& name, int value);
 
53
        void set_attribute(const String& name);
52
54
        void unlink();
53
55
        xmlNodePtr get_node();
54
56
        xmlNodePtr get_parent() const;
55
 
        Glib::ustring get_path() const;
 
57
        String get_path() const;
56
58
        xmlDocPtr get_document();
57
59
};
58
60
 
60
62
{
61
63
private:
62
64
        xmlDocPtr document;
63
 
        Glib::ustring url;
 
65
        String url;
64
66
 
65
67
public:
66
68
        XmlDocument();  
67
69
        XmlDocument(const XmlDocument& document);
68
 
        XmlDocument(const Glib::ustring& url, bool create_if_dne = true);
 
70
        XmlDocument(const String& url, bool create_if_dne = true);
69
71
        ~XmlDocument();
70
72
        
71
73
        xmlDocPtr get_document()        { return document; }
72
 
        Glib::ustring get_url()         { return url; }
 
74
        String get_url()                        { return url; }
73
75
        
74
 
        void load(const Glib::ustring& url, bool create_if_dne = true);
75
 
        void save(const Glib::ustring& to);
 
76
        void load(const String& url, bool create_if_dne = true);
 
77
        void save(const String& to);
76
78
        void save();
77
79
        xmlNodePtr get_root_node();
78
 
        xmlNodePtr create_root_node(const Glib::ustring& name);
 
80
        xmlNodePtr create_root_node(const String& name);
79
81
        
80
 
        Glib::ustring to_string(gboolean pretty = false) const;
 
82
        String to_string(gboolean pretty = false) const;
81
83
};
82
84
 
83
85
class XPathResult
107
109
        XPath(xmlDocPtr document);
108
110
        ~XPath();
109
111
        
110
 
        xmlXPathObjectPtr evaluate_expression(const Glib::ustring& expression);
111
 
        xmlNodePtr evaluate_expression_single(const Glib::ustring& expression);
 
112
        xmlXPathObjectPtr evaluate_expression(const String& expression);
 
113
        xmlNodePtr evaluate_expression_single(const String& expression);
112
114
};
113
115
 
114
116
#endif