diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 |
commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /include/llvm/Object/WindowsResource.h | |
parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) |
Notes
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 { |