diff options
Diffstat (limited to 'include/llvm/Object/WindowsResource.h')
-rw-r--r-- | include/llvm/Object/WindowsResource.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/llvm/Object/WindowsResource.h b/include/llvm/Object/WindowsResource.h index 3d32409fd4ac..a077c82871bf 100644 --- a/include/llvm/Object/WindowsResource.h +++ b/include/llvm/Object/WindowsResource.h @@ -85,6 +85,12 @@ struct WinResHeaderSuffix { support::ulittle32_t Characteristics; }; +class EmptyResError : public GenericBinaryError { +public: + EmptyResError(Twine Msg, object_error ECOverride) + : GenericBinaryError(Msg, ECOverride) {} +}; + class ResourceEntryRef { public: Error moveNext(bool &End); @@ -94,7 +100,9 @@ public: bool checkNameString() const { return IsStringName; } ArrayRef<UTF16> getNameString() const { return Name; } uint16_t getNameID() const { return NameID; } + uint16_t getDataVersion() const { return Suffix->DataVersion; } uint16_t getLanguage() const { return Suffix->Language; } + uint16_t getMemoryFlags() const { return Suffix->MemoryFlags; } uint16_t getMajorVersion() const { return Suffix->Version >> 16; } uint16_t getMinorVersion() const { return Suffix->Version; } uint32_t getCharacteristics() const { return Suffix->Characteristics; } @@ -103,11 +111,12 @@ public: private: friend class WindowsResource; - ResourceEntryRef(BinaryStreamRef Ref, const WindowsResource *Owner, - Error &Err); - + ResourceEntryRef(BinaryStreamRef Ref, const WindowsResource *Owner); Error loadNext(); + static Expected<ResourceEntryRef> create(BinaryStreamRef Ref, + const WindowsResource *Owner); + BinaryStreamReader Reader; bool IsStringType; ArrayRef<UTF16> Type; @@ -117,7 +126,6 @@ private: uint16_t NameID; const WinResHeaderSuffix *Suffix = nullptr; ArrayRef<uint8_t> Data; - const WindowsResource *OwningRes = nullptr; }; class WindowsResource : public Binary { |