osdata.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Routines for handling XML generic OS data provided by target.
  2. Copyright (C) 2008-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef OSDATA_H
  15. #define OSDATA_H
  16. #include <vector>
  17. struct osdata_column
  18. {
  19. osdata_column (std::string &&name_, std::string &&value_)
  20. : name (std::move (name_)), value (std::move (value_))
  21. {}
  22. std::string name;
  23. std::string value;
  24. };
  25. struct osdata_item
  26. {
  27. std::vector<osdata_column> columns;
  28. };
  29. struct osdata
  30. {
  31. osdata (std::string &&type_)
  32. : type (std::move (type_))
  33. {}
  34. std::string type;
  35. std::vector<osdata_item> items;
  36. };
  37. std::unique_ptr<osdata> osdata_parse (const char *xml);
  38. std::unique_ptr<osdata> get_osdata (const char *type);
  39. const std::string *get_osdata_column (const osdata_item &item,
  40. const char *name);
  41. /* Dump TYPE info to the current uiout builder. If TYPE is either
  42. NULL or empty, then dump the top level table that lists the
  43. available types of OS data. */
  44. void info_osdata (const char *type);
  45. #endif /* OSDATA_H */