00001
00002
00003 #ifndef _GSTMM_XML_H
00004 #define _GSTMM_XML_H
00005
00006
00007 #include <glibmm.h>
00008
00009 #include <gstreamermm/object.h>
00010 #include <gstreamermm/enums.h>
00011
00012
00013 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00014 typedef struct _GstXML GstXML;
00015 typedef struct _GstXMLClass GstXMLClass;
00016 #endif
00017
00018
00019 namespace Gst
00020 { class XML_Class; }
00021 namespace Gst
00022 {
00023
00024 class Element;
00025
00026
00027 class XML : public Object
00028 {
00029
00030 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00031
00032 public:
00033 typedef XML CppObjectType;
00034 typedef XML_Class CppClassType;
00035 typedef GstXML BaseObjectType;
00036 typedef GstXMLClass BaseClassType;
00037
00038 private: friend class XML_Class;
00039 static CppClassType xml_class_;
00040
00041 private:
00042
00043 XML(const XML&);
00044 XML& operator=(const XML&);
00045
00046 protected:
00047 explicit XML(const Glib::ConstructParams& construct_params);
00048 explicit XML(GstXML* castitem);
00049
00050 #endif
00051
00052 public:
00053 virtual ~XML();
00054
00055 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00056 static GType get_type() G_GNUC_CONST;
00057 static GType get_base_type() G_GNUC_CONST;
00058 #endif
00059
00061 GstXML* gobj() { return reinterpret_cast<GstXML*>(gobject_); }
00062
00064 const GstXML* gobj() const { return reinterpret_cast<GstXML*>(gobject_); }
00065
00067 GstXML* gobj_copy();
00068
00069 private:
00070
00071
00072 protected:
00073 XML();
00074
00075 public:
00076
00077 static Glib::RefPtr<XML> create();
00078
00079
00080 bool parse_doc(xmlDocPtr doc, const std::string& root);
00081
00082 bool parse_file(const std::string& filename, const std::string& root);
00083 bool parse_memory(const std::string& buffer, const std::string& root);
00084
00085 Glib::RefPtr<Element> get_element(const std::string& name);
00086
00087 Glib::RefPtr<const Element> get_element(const std::string& name) const;
00088
00089
00090
00091
00092
00093 public:
00094
00095 public:
00096
00097 #ifdef GLIBMM_VFUNCS_ENABLED
00098 #endif //GLIBMM_VFUNCS_ENABLED
00099
00100 protected:
00101
00102 #ifdef GLIBMM_VFUNCS_ENABLED
00103 #endif //GLIBMM_VFUNCS_ENABLED
00104
00105
00106 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00107 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00108
00109
00110 };
00111
00112 xmlDocPtr write_xml(const Glib::RefPtr<Element>& element);
00113 int write_xml_file(const Glib::RefPtr<Element>& element, const std::string& filename);
00114 Glib::RefPtr<Element> make_element(const xmlNodePtr& xml_node, const Glib::RefPtr<Object>& parent);
00115
00116 }
00117
00118
00119 namespace Glib
00120 {
00129 Glib::RefPtr<Gst::XML> wrap(GstXML* object, bool take_copy = false);
00130 }
00131
00132
00133 #endif
00134