tag.hpp 705 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2005 Carl Barron. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying file
  3. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #ifndef SIMPLE_XML_TAG_H
  5. #define SIMPLE_XML_TAG_H
  6. #include <boost/variant.hpp>
  7. #include <list>
  8. #include <map>
  9. #include <string>
  10. struct tag
  11. {
  12. std::string id;
  13. std::map<std::string,std::string> attributes;
  14. typedef boost::variant<
  15. std::string,
  16. boost::recursive_wrapper<tag>
  17. >
  18. variant_type;
  19. std::list<variant_type> children;
  20. };
  21. struct walk_data
  22. {
  23. typedef void result_type;
  24. void operator () (const std::string &x);
  25. void operator () (const tag &t);
  26. };
  27. #endif