LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::ResourceStringTable Class Reference

This class represents the StringTable structure. This structure can be seen as a dictionary of key, values with key and values defined a utf-16 string. More...

#include <ResourceStringTable.hpp>

Inheritance diagram for LIEF::PE::ResourceStringTable:
Collaboration diagram for LIEF::PE::ResourceStringTable:

Classes

struct  entry_t
 An entry in this table which is composed of an UTF-16 key and an UTF-16 value. More...
 

Public Types

using entries_t = std::vector<entry_t>
 
using it_entries = ref_iterator<entries_t&>
 
using it_const_entries = const_ref_iterator<const entries_t&>
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 ResourceStringTable ()=default
 
 ResourceStringTable (const ResourceStringTable &)=default
 
ResourceStringTableoperator= (const ResourceStringTable &)=default
 
 ResourceStringTable (ResourceStringTable &&)=default
 
ResourceStringTableoperator= (ResourceStringTable &&)=default
 
 ~ResourceStringTable () override=default
 
const std::u16string & key () const
 An 8-digit hexadecimal number stored as a Unicode string. The four most significant digits represent the language identifier. The four least significant digits represent the code page for which the data is formatted. Each Microsoft Standard Language identifier contains two parts: the low-order 10 bits specify the major language, and the high-order 6 bits specify the sublanguage.
 
uint16_t type () const
 The type of data in the version resource:
 
std::string key_u8 () const
 The key as an utf8 string.
 
it_entries entries ()
 Iterator over the different entry_t element of this table.
 
it_const_entries entries () const
 
optional< std::u16string > get (const std::u16string &key) const
 
optional< std::string > get (const std::string &key) const
 
ResourceStringTablekey (std::u16string value)
 
ResourceStringTabletype (uint16_t value)
 
void add_entry (entry_t entry)
 
void add_entry (std::u16string key, std::u16string value)
 
void accept (Visitor &visitor) const override
 
optional< std::string > operator[] (const std::string &str) const
 
optional< std::u16string > operator[] (const std::u16string &str) const
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Static Public Member Functions

static result< ResourceStringTableparse (BinaryStream &stream)
 

Detailed Description

This class represents the StringTable structure. This structure can be seen as a dictionary of key, values with key and values defined a utf-16 string.

Member Typedef Documentation

◆ entries_t

◆ it_const_entries

◆ it_entries

Constructor & Destructor Documentation

◆ ResourceStringTable() [1/3]

LIEF::PE::ResourceStringTable::ResourceStringTable ( )
default

◆ ResourceStringTable() [2/3]

LIEF::PE::ResourceStringTable::ResourceStringTable ( const ResourceStringTable & )
default

◆ ResourceStringTable() [3/3]

LIEF::PE::ResourceStringTable::ResourceStringTable ( ResourceStringTable && )
default

◆ ~ResourceStringTable()

LIEF::PE::ResourceStringTable::~ResourceStringTable ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::PE::ResourceStringTable::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ add_entry() [1/2]

void LIEF::PE::ResourceStringTable::add_entry ( entry_t entry)
inline

◆ add_entry() [2/2]

void LIEF::PE::ResourceStringTable::add_entry ( std::u16string key,
std::u16string value )
inline

◆ entries() [1/2]

it_entries LIEF::PE::ResourceStringTable::entries ( )
inline

Iterator over the different entry_t element of this table.

◆ entries() [2/2]

it_const_entries LIEF::PE::ResourceStringTable::entries ( ) const
inline

◆ get() [1/2]

optional< std::string > LIEF::PE::ResourceStringTable::get ( const std::string & key) const

◆ get() [2/2]

optional< std::u16string > LIEF::PE::ResourceStringTable::get ( const std::u16string & key) const
inline

References LIEF::nullopt().

◆ key() [1/2]

const std::u16string & LIEF::PE::ResourceStringTable::key ( ) const
inline

An 8-digit hexadecimal number stored as a Unicode string. The four most significant digits represent the language identifier. The four least significant digits represent the code page for which the data is formatted. Each Microsoft Standard Language identifier contains two parts: the low-order 10 bits specify the major language, and the high-order 6 bits specify the sublanguage.

◆ key() [2/2]

ResourceStringTable & LIEF::PE::ResourceStringTable::key ( std::u16string value)
inline

◆ key_u8()

std::string LIEF::PE::ResourceStringTable::key_u8 ( ) const

The key as an utf8 string.

◆ operator=() [1/2]

ResourceStringTable & LIEF::PE::ResourceStringTable::operator= ( const ResourceStringTable & )
default

◆ operator=() [2/2]

ResourceStringTable & LIEF::PE::ResourceStringTable::operator= ( ResourceStringTable && )
default

◆ operator[]() [1/2]

optional< std::string > LIEF::PE::ResourceStringTable::operator[] ( const std::string & str) const
inline

◆ operator[]() [2/2]

optional< std::u16string > LIEF::PE::ResourceStringTable::operator[] ( const std::u16string & str) const
inline

◆ parse()

static result< ResourceStringTable > LIEF::PE::ResourceStringTable::parse ( BinaryStream & stream)
static

◆ type() [1/2]

uint16_t LIEF::PE::ResourceStringTable::type ( ) const
inline

The type of data in the version resource:

  • 1 if it contains text data
  • 0 if it contains binary

◆ type() [2/2]

ResourceStringTable & LIEF::PE::ResourceStringTable::type ( uint16_t value)
inline

The documentation for this class was generated from the following file: