/*************************************************************************** source::worx xtree Copyright © 2024-2025 c.holzheuer christoph.holzheuer@gmail.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ***************************************************************************/ #ifndef XTREEWALKER_H #define XTREEWALKER_H #include #include /** * @brief A implentation of the pugi::xml treewalker class. */ template class xtreewalker : public pugi::xml_tree_walker { public: xtreewalker( O* object, M member ) { _call = std::bind(member, object, std::placeholders::_1, std::placeholders::_2); } virtual bool for_each(pugi::xml_node& node) override { return _call(node,depth()); } protected: std::function _call; }; #endif // XTREEWALKER_H