diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-08-13 01:17:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-08-13 01:17:09 +0100 |
| commit | c2ec345242b680426938ed3ef7332ede1d3276a6 (patch) | |
| tree | a874651b7d1047fc34c047fde15c7d7029c35e10 /src/xml.h | |
| parent | 830d8e01713add5856f44a5246eb65781458d0b8 (diff) | |
Partial subtitle work.
Diffstat (limited to 'src/xml.h')
| -rw-r--r-- | src/xml.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -33,6 +33,9 @@ protected: void ignore_node (std::string); void done (); + Time time_attribute (std::string); + float float_attribute (std::string); + template <class T> boost::shared_ptr<T> sub_node (std::string name) { return boost::shared_ptr<T> (new T (xml_node (name))); @@ -51,9 +54,8 @@ protected: } template <class T> - std::list<boost::shared_ptr<T> > sub_nodes (std::string name, std::string sub) { - XMLNode p (xml_node (name)); - std::list<xmlpp::Node*> n = p.xml_nodes (sub); + std::list<boost::shared_ptr<T> > sub_nodes (std::string name) { + std::list<xmlpp::Node*> n = xml_nodes (name); std::list<boost::shared_ptr<T> > r; for (typename std::list<xmlpp::Node*>::iterator i = n.begin(); i != n.end(); ++i) { r.push_back (boost::shared_ptr<T> (new T (*i))); @@ -61,6 +63,12 @@ protected: return r; } + template <class T> + std::list<boost::shared_ptr<T> > sub_nodes (std::string name, std::string sub) { + XMLNode p (xml_node (name)); + return p.sub_nodes<T> (sub); + } + xmlpp::Node const * _node; private: |
