diff options
author | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:12 +0200 |
---|---|---|
committer | Marcin Kolny <marcin.kolny@gmail.com> | 2015-08-08 14:45:59 +0200 |
commit | 0d5f63b18f5766760cf39e82ee11482984e0a938 (patch) | |
tree | e3f74b9b37e7618c92840024077dff43e6d08f0d /examples/markup/parser.cc | |
parent | dce7a844e48a582e42eb2b60eef5c1f2527540ac (diff) | |
parent | d94115843f38967b5e883f5f7d8057882ae364cb (diff) | |
download | glibmm-gir-gmmproc.tar.gz |
Merge branch 'master' into glibmm-gir-gmmprocglibmm-gir-gmmproc
Diffstat (limited to 'examples/markup/parser.cc')
-rw-r--r-- | examples/markup/parser.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/markup/parser.cc b/examples/markup/parser.cc index 30423a66..b954a671 100644 --- a/examples/markup/parser.cc +++ b/examples/markup/parser.cc @@ -26,7 +26,7 @@ namespace void file_get_contents(const std::string& filename, Glib::ustring& contents) { - const Glib::RefPtr<Glib::IOChannel> channel = Glib::IOChannel::create_from_file(filename, "r"); + const auto channel = Glib::IOChannel::create_from_file(filename, "r"); channel->read_to_end(contents); } @@ -54,14 +54,14 @@ public: virtual ~DumpParser(); protected: - virtual void on_start_element(Glib::Markup::ParseContext& context, + void on_start_element(Glib::Markup::ParseContext& context, const Glib::ustring& element_name, - const AttributeMap& attributes); + const AttributeMap& attributes) override; - virtual void on_end_element(Glib::Markup::ParseContext& context, - const Glib::ustring& element_name); + void on_end_element(Glib::Markup::ParseContext& context, + const Glib::ustring& element_name) override; - virtual void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text); + void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text) override; private: int parse_depth_; @@ -84,9 +84,9 @@ void DumpParser::on_start_element(Glib::Markup::ParseContext&, indent(); std::cout << '<' << element_name; - for(AttributeMap::const_iterator p = attributes.begin(); p != attributes.end(); ++p) + for(const auto& p : attributes) { - std::cout << ' ' << p->first << "=\"" << p->second << '"'; + std::cout << ' ' << p.first << "=\"" << p.second << '"'; } std::cout << ">\n"; |