LLVM  10.0.0
ResourceProcessor.h
Go to the documentation of this file.
1 //===-- ResourceProcessor.h -------------------------------------*- C++-*-===//
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 LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
10 #define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
11 
12 #include "llvm/ADT/StringMap.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
16 
17 #include <memory>
18 #include <vector>
19 
20 
21 namespace llvm {
22 
24 public:
26 
28 
30  PreprocessorDefines.emplace_back(Key, Value);
31  }
32  void addInclude(const PathType &IncludePath) {
33  IncludeList.push_back(IncludePath);
34  }
35  void setVerbose(bool Verbose) { IsVerbose = Verbose; }
36  void setNullAtEnd(bool NullAtEnd) { AppendNull = NullAtEnd; }
37 
38  Error process(StringRef InputData,
39  std::unique_ptr<raw_fd_ostream> OutputStream);
40 
41 private:
42  StringRef InputData;
43  std::vector<PathType> IncludeList;
44  std::vector<std::pair<StringRef, StringRef>> PreprocessorDefines;
45  bool IsVerbose, AppendNull;
46 };
47 
48 }
49 
50 #endif
void setNullAtEnd(bool NullAtEnd)
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Key
PAL metadata keys.
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:837
Error process(StringRef InputData, std::unique_ptr< raw_fd_ostream > OutputStream)
void addDefine(StringRef Key, StringRef Value=StringRef())
void addInclude(const PathType &IncludePath)
LLVM Value Representation.
Definition: Value.h:74
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:54