cmCTestTestMeasurementXMLParser.cxx 861 B

1234567891011121314151617181920212223242526
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #include "cmCTestTestMeasurementXMLParser.h"
  4. #include <cstring>
  5. void cmCTestTestMeasurementXMLParser::StartElement(const std::string& name,
  6. const char** attributes)
  7. {
  8. this->CharacterData.clear();
  9. this->ElementName = name;
  10. for (const char** attr = attributes; *attr; attr += 2) {
  11. if (strcmp(attr[0], "name") == 0) {
  12. this->MeasurementName = attr[1];
  13. } else if (strcmp(attr[0], "type") == 0) {
  14. this->MeasurementType = attr[1];
  15. }
  16. }
  17. }
  18. void cmCTestTestMeasurementXMLParser::CharacterDataHandler(const char* data,
  19. int length)
  20. {
  21. this->CharacterData.append(data, length);
  22. }