28#ifndef LLVM_OBJECT_WINDOWSRESOURCE_H
29#define LLVM_OBJECT_WINDOWSRESOURCE_H
51class ResourceSectionRef;
52struct coff_resource_dir_table;
159 std::vector<std::string> &Duplicates);
168 template <
typename T>
169 using Children = std::map<T, std::unique_ptr<TreeNode>>;
181 return StringChildren;
188 static std::unique_ptr<TreeNode> createStringNode(
uint32_t Index);
189 static std::unique_ptr<TreeNode> createIDNode();
191 static std::unique_ptr<TreeNode> createDataNode(
uint16_t MajorVersion,
202 std::vector<std::vector<uint8_t>> &Data,
210 std::vector<std::vector<uint8_t>> &Data,
220 bool IsDataNode =
false;
246 std::vector<StringOrID> &Context,
247 std::vector<std::string> &Duplicates);
249 bool shouldIgnoreDuplicate(
const std::vector<StringOrID> &Context)
const;
252 std::vector<std::vector<uint8_t>> Data;
255 std::vector<std::string> InputFilenames;
262 const WindowsResourceParser &Parser,
COFFYAML::WeakExternalCharacteristics Characteristics
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.
Provides read only access to a subclass of BinaryStream.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
A table of densely packed, null-terminated strings indexed by offset.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
EmptyResError(Twine Msg, object_error ECOverride)
uint16_t getDataVersion() const
uint16_t getMajorVersion() const
uint16_t getLanguage() const
Error moveNext(bool &End)
ArrayRef< UTF16 > getTypeString() const
uint16_t getNameID() const
uint16_t getTypeID() const
uint16_t getMemoryFlags() const
bool checkNameString() const
uint16_t getMinorVersion() const
uint32_t getCharacteristics() const
bool checkTypeString() const
ArrayRef< UTF16 > getNameString() const
ArrayRef< uint8_t > getData() const
const Children< std::string > & getStringChildren() const
uint16_t getMinorVersion() const
uint32_t getTreeSize() const
const Children< uint32_t > & getIDChildren() const
void print(ScopedPrinter &Writer, StringRef Name) const
uint32_t getCharacteristics() const
uint32_t getDataIndex() const
uint32_t getStringIndex() const
uint16_t getMajorVersion() const
bool checkIsDataNode() const
std::map< T, std::unique_ptr< TreeNode > > Children
void cleanUpManifests(std::vector< std::string > &Duplicates)
const TreeNode & getTree() const
void printTree(raw_ostream &OS) const
ArrayRef< std::vector< uint8_t > > getData() const
ArrayRef< std::vector< UTF16 > > getStringTable() const
Expected< ResourceEntryRef > getHeadEntry()
static bool classof(const Binary *V)
static Expected< std::unique_ptr< WindowsResource > > createWindowsResource(MemoryBufferRef Source)
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Expected< std::unique_ptr< MemoryBuffer > > writeWindowsResourceCOFF(llvm::COFF::MachineTypes MachineType, const WindowsResourceParser &Parser, uint32_t TimeDateStamp)
const size_t WIN_RES_NULL_ENTRY_SIZE
const uint32_t WIN_RES_DATA_ALIGNMENT
void printResourceTypeName(uint16_t TypeID, raw_ostream &OS)
const uint32_t WIN_RES_HEADER_ALIGNMENT
const size_t WIN_RES_MAGIC_SIZE
const uint16_t WIN_RES_PURE_MOVEABLE
This is an optimization pass for GlobalISel generic memory operations.
@ Ref
The access may reference the value stored in memory.
support::ulittle16_t TypeID
support::ulittle16_t NameID
void setType(uint16_t ID)
void setName(uint16_t ID)
StringOrID(ArrayRef< UTF16 > String)