LLDB mainline
XMLParser.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_XMLPARSER_H
10#define LLDB_HOST_XMLPARSER_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/StringRef.h"
14#include "llvm/Support/Error.h"
15
16namespace lldb_private {
17namespace xml {
18
19struct Attribute {
20 llvm::StringRef name;
21 llvm::StringRef value;
22};
23
24class Handler {
25public:
26 virtual ~Handler();
27 virtual void StartElement(llvm::StringRef name,
28 llvm::ArrayRef<Attribute> attributes) {}
29 virtual void EndElement(llvm::StringRef name) {}
30 /// Called once with all the character data between two tags, including
31 /// expanded references and CDATA sections.
32 virtual void Characters(llvm::StringRef text) {}
33};
34
35/// Parse an XML 1.0 document without validating it.
36llvm::Error Parse(llvm::StringRef input, Handler &handler);
37
38} // namespace xml
39} // namespace lldb_private
40
41#endif // LLDB_HOST_XMLPARSER_H
virtual void StartElement(llvm::StringRef name, llvm::ArrayRef< Attribute > attributes)
Definition XMLParser.h:27
virtual void EndElement(llvm::StringRef name)
Definition XMLParser.h:29
virtual void Characters(llvm::StringRef text)
Called once with all the character data between two tags, including expanded references and CDATA sec...
Definition XMLParser.h:32
llvm::Error Parse(llvm::StringRef input, Handler &handler)
Parse an XML 1.0 document without validating it.
A class that represents a running process on the host machine.