summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestMeasurementXMLParser.cxx
blob: 636be2451ad1802d5a73ff59c127c437041a28b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */

#include "cmCTestTestMeasurementXMLParser.h"

#include <cstring>

void cmCTestTestMeasurementXMLParser::StartElement(const std::string& name,
                                                   const char** attributes)
{
  this->CharacterData.clear();
  this->ElementName = name;
  for (const char** attr = attributes; *attr; attr += 2) {
    if (strcmp(attr[0], "name") == 0) {
      this->MeasurementName = attr[1];
    } else if (strcmp(attr[0], "type") == 0) {
      this->MeasurementType = attr[1];
    }
  }
}

void cmCTestTestMeasurementXMLParser::CharacterDataHandler(const char* data,
                                                           int length)
{
  this->CharacterData.append(data, length);
}