1 //===-- ResourceProcessor.h -------------------------------------*- C++-*-===//
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
7 //===---------------------------------------------------------------------===//
9 #ifndef LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
10 #define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
12 #include "llvm/ADT/StringMap.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/raw_ostream.h"
23 class WindowsResourceProcessor {
25 using PathType = SmallVector<char, 64>;
27 WindowsResourceProcessor() {}
29 void addDefine(StringRef Key, StringRef Value = StringRef()) {
30 PreprocessorDefines.emplace_back(Key, Value);
32 void addInclude(const PathType &IncludePath) {
33 IncludeList.push_back(IncludePath);
35 void setVerbose(bool Verbose) { IsVerbose = Verbose; }
36 void setNullAtEnd(bool NullAtEnd) { AppendNull = NullAtEnd; }
38 Error process(StringRef InputData,
39 std::unique_ptr<raw_fd_ostream> OutputStream);
43 std::vector<PathType> IncludeList;
44 std::vector<std::pair<StringRef, StringRef>> PreprocessorDefines;
45 bool IsVerbose, AppendNull;