1326938Sdim//===-- ResourceProcessor.h -------------------------------------*- C++-*-===// 2326938Sdim// 3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4353358Sdim// See https://llvm.org/LICENSE.txt for license information. 5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6326938Sdim// 7326938Sdim//===---------------------------------------------------------------------===// 8326938Sdim 9326938Sdim#ifndef LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H 10326938Sdim#define LLVM_INCLUDE_LLVM_SUPPORT_WINDOWS_RESOURCE_PROCESSOR_H 11326938Sdim 12326938Sdim#include "llvm/ADT/StringMap.h" 13326938Sdim#include "llvm/ADT/StringRef.h" 14326938Sdim#include "llvm/Support/Error.h" 15326938Sdim#include "llvm/Support/raw_ostream.h" 16326938Sdim 17326938Sdim#include <memory> 18326938Sdim#include <vector> 19326938Sdim 20326938Sdim 21326938Sdimnamespace llvm { 22326938Sdim 23326938Sdimclass WindowsResourceProcessor { 24326938Sdimpublic: 25326938Sdim using PathType = SmallVector<char, 64>; 26326938Sdim 27326938Sdim WindowsResourceProcessor() {} 28326938Sdim 29326938Sdim void addDefine(StringRef Key, StringRef Value = StringRef()) { 30326938Sdim PreprocessorDefines.emplace_back(Key, Value); 31326938Sdim } 32326938Sdim void addInclude(const PathType &IncludePath) { 33326938Sdim IncludeList.push_back(IncludePath); 34326938Sdim } 35326938Sdim void setVerbose(bool Verbose) { IsVerbose = Verbose; } 36326938Sdim void setNullAtEnd(bool NullAtEnd) { AppendNull = NullAtEnd; } 37326938Sdim 38326938Sdim Error process(StringRef InputData, 39326938Sdim std::unique_ptr<raw_fd_ostream> OutputStream); 40326938Sdim 41326938Sdimprivate: 42326938Sdim StringRef InputData; 43326938Sdim std::vector<PathType> IncludeList; 44326938Sdim std::vector<std::pair<StringRef, StringRef>> PreprocessorDefines; 45326938Sdim bool IsVerbose, AppendNull; 46326938Sdim}; 47326938Sdim 48326938Sdim} 49326938Sdim 50326938Sdim#endif 51