Go to the documentation of this file.
28 #ifndef LLVM_OBJECT_WINDOWSRESOURCE_H
29 #define LLVM_OBJECT_WINDOWSRESOURCE_H
50 class WindowsResource;
51 class ResourceSectionRef;
52 struct 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,
203 std::vector<std::vector<UTF16>> &StringTable,
206 std::vector<std::vector<UTF16>> &StringTable);
208 std::vector<std::vector<UTF16>> &StringTable);
210 std::vector<std::vector<uint8_t>> &
Data,
217 std::vector<std::vector<UTF16>> &StringTable);
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;
253 std::vector<std::vector<UTF16>> StringTable;
255 std::vector<std::string> InputFilenames;
262 const WindowsResourceParser &Parser,
uint32_t getStringIndex() const
uint16_t getMajorVersion() const
std::map< T, std::unique_ptr< TreeNode > > Children
void printTree(raw_ostream &OS) const
This is an optimization pass for GlobalISel generic memory operations.
static Expected< std::unique_ptr< WindowsResource > > createWindowsResource(MemoryBufferRef Source)
ArrayRef< UTF16 > getNameString() const
uint32_t getCharacteristics() const
uint16_t getMemoryFlags() const
ArrayRef< uint8_t > getData() const
uint32_t getDataIndex() const
const uint16_t WIN_RES_PURE_MOVEABLE
uint16_t getMinorVersion() const
uint16_t getTypeID() const
The instances of the Type class are immutable: once they are created, they are never changed.
const Children< std::string > & getStringChildren() const
const Children< uint32_t > & getIDChildren() const
Tagged union holding either a T or a Error.
ArrayRef< UTF16 > getTypeString() const
void setName(uint16_t ID)
bool checkIsDataNode() const
bool checkTypeString() const
uint32_t getCharacteristics() const
An implementation of BinaryStream which holds its entire data set in a single contiguous buffer.
uint16_t getMinorVersion() const
uint16_t getMajorVersion() const
const uint32_t WIN_RES_DATA_ALIGNMENT
StringOrID(ArrayRef< UTF16 > String)
const TreeNode & getTree() const
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.
Provides read only access to a subclass of BinaryStream.
EmptyResError(Twine Msg, object_error ECOverride)
bar al al movzbl eax ret Missed when stored in a memory object
Error parse(WindowsResource *WR, std::vector< std::string > &Duplicates)
WindowsResourceParser(bool MinGW=false)
const size_t WIN_RES_NULL_ENTRY_SIZE
ArrayRef< std::vector< UTF16 > > getStringTable() const
Expected< std::unique_ptr< MemoryBuffer > > writeWindowsResourceCOFF(llvm::COFF::MachineTypes MachineType, const WindowsResourceParser &Parser, uint32_t TimeDateStamp)
void cleanUpManifests(std::vector< std::string > &Duplicates)
uint16_t getDataVersion() const
uint16_t getLanguage() const
StringRef - Represent a constant reference to a string, i.e.
void setType(uint16_t ID)
uint16_t getNameID() const
void print(ScopedPrinter &Writer, StringRef Name) const
void printResourceTypeName(uint16_t TypeID, raw_ostream &OS)
ArrayRef< std::vector< uint8_t > > getData() const
static bool classof(const Binary *V)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
uint32_t getTreeSize() const
Lightweight error class with error context and mandatory checking.
Expected< ResourceEntryRef > getHeadEntry()
const uint32_t WIN_RES_HEADER_ALIGNMENT
bool checkNameString() const
support::ulittle16_t NameID
const size_t WIN_RES_MAGIC_SIZE
COFFYAML::WeakExternalCharacteristics Characteristics
support::ulittle16_t TypeID
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Error moveNext(bool &End)