1 //===-- ResourceProcessor.h -------------------------------------*- C++-*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===---------------------------------------------------------------------===//
10 #ifndef LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
11 #define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H
13 #include "llvm/ADT/StringMap.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Error.h"
16 #include "llvm/Support/raw_ostream.h"
24 class WindowsResourceProcessor {
26 using PathType = SmallVector<char, 64>;
28 WindowsResourceProcessor() {}
30 void addDefine(StringRef Key, StringRef Value = StringRef()) {
31 PreprocessorDefines.emplace_back(Key, Value);
33 void addInclude(const PathType &IncludePath) {
34 IncludeList.push_back(IncludePath);
36 void setVerbose(bool Verbose) { IsVerbose = Verbose; }
37 void setNullAtEnd(bool NullAtEnd) { AppendNull = NullAtEnd; }
39 Error process(StringRef InputData,
40 std::unique_ptr<raw_fd_ostream> OutputStream);
44 std::vector<PathType> IncludeList;
45 std::vector<std::pair<StringRef, StringRef>> PreprocessorDefines;
46 bool IsVerbose, AppendNull;