retdec
Public Member Functions | Private Attributes | Friends | List of all members
PeLib::ResourceChild Class Reference

The class ResourceChild is used to store information about a resource node. More...

#include <ResourceDirectory.h>

Collaboration diagram for PeLib::ResourceChild:
Collaboration graph
[legend]

Public Member Functions

bool equalId (std::uint32_t wId) const
 Function which compares a resource ID to the node's resource ID. More...
 
bool equalName (std::string strName) const
 Function which compares a string to the node's resource name. More...
 
bool isNamedResource () const
 Predicate that determines if a child is identified by name or by ID. More...
 
bool operator< (const ResourceChild &rc) const
 Used for sorting a node's children. More...
 
bool hasEqual (std::uint32_t id) const
 A comparison function for searching a resource element by its ID. More...
 
bool hasEqual (const std::string &name) const
 A comparison function for searching a resource element by its name. More...
 
unsigned int getNumberOfChildren () const
 Returns the node's number of children. More...
 
ResourceChildgetChildOfThisChild (std::size_t uiIndex)
 Returns a child of this child. More...
 
const ResourceChildgetChildOfThisChild (std::size_t uiIndex) const
 
ResourceElementgetNode ()
 Returns a pointer to ResourceElement. More...
 
const ResourceElementgetNode () const
 
void setNode (ResourceElement *node)
 Sets a pointer to ResourceElement. More...
 
std::string getName () const
 Returns the name of the node. More...
 
std::uint32_t getOffsetToName () const
 Returns the Name value of the node. More...
 
std::uint32_t getOffsetToData () const
 Returns the OffsetToData value of the node. More...
 
void setName (const std::string &strNewName)
 Sets the name of the node. More...
 
void setOffsetToName (std::uint32_t dwNewOffset)
 Sets the Name value of the node. More...
 
void setOffsetToData (std::uint32_t dwNewOffset)
 Sets the OffsetToData value of the node. More...
 
 ResourceChild ()
 Returns the size of a resource child. More...
 
 ResourceChild (const ResourceChild &rhs)
 Makes a deep copy of a ResourceChild object. More...
 
ResourceChildoperator= (const ResourceChild &rhs)
 Makes a deep copy of a ResourceChild object. More...
 
 ~ResourceChild ()
 Deletes a ResourceChild object. More...
 

Private Attributes

PELIB_IMG_RES_DIR_ENTRY entry
 Stores name and offset of a resource node. More...
 
ResourceElementchild
 A pointer to one of the node's child nodes. More...
 

Friends

class ResourceElement
 
class ResourceDirectory
 
class ResourceNode
 
class ResourceLeaf
 

Detailed Description

The class ResourceChild is used to store information about a resource node.

Constructor & Destructor Documentation

◆ ResourceChild() [1/2]

PeLib::ResourceChild::ResourceChild ( )

Returns the size of a resource child.

Standard constructor. Does absolutely nothing.

◆ ResourceChild() [2/2]

PeLib::ResourceChild::ResourceChild ( const ResourceChild rhs)

Makes a deep copy of a ResourceChild object.

◆ ~ResourceChild()

PeLib::ResourceChild::~ResourceChild ( )

Deletes a ResourceChild object.

Member Function Documentation

◆ equalId()

bool PeLib::ResourceChild::equalId ( std::uint32_t  dwId) const

Function which compares a resource ID to the node's resource ID.

Compares the resource child's id to the parameter dwId.

Parameters
dwIdID of a resource.
Returns
True, if the resource child's id equals the parameter.

◆ equalName()

bool PeLib::ResourceChild::equalName ( std::string  strName) const

Function which compares a string to the node's resource name.

Compares the resource child's name to the parameter strName.

Parameters
strNameID of a resource.
Returns
True, if the resource child's name equals the parameter.

◆ getChildOfThisChild() [1/2]

ResourceChild * PeLib::ResourceChild::getChildOfThisChild ( std::size_t  uiIndex)

Returns a child of this child.

Returns a child of this child.

◆ getChildOfThisChild() [2/2]

const ResourceChild * PeLib::ResourceChild::getChildOfThisChild ( std::size_t  uiIndex) const

Returns a child of this child.

◆ getName()

std::string PeLib::ResourceChild::getName ( ) const

Returns the name of the node.

Returns the name of the node.

Returns
Name of the node.

◆ getNode() [1/2]

ResourceElement * PeLib::ResourceChild::getNode ( )

Returns a pointer to ResourceElement.

Returns ResourceElement associated with this ResourceChild. It can be either ResourceNode or ResourceLeaf.

Returns
Associated ResourceElement.

◆ getNode() [2/2]

const ResourceElement * PeLib::ResourceChild::getNode ( ) const

Returns ResourceElement associated with this ResourceChild. It can be either ResourceNode or ResourceLeaf.

Returns
Associated ResourceElement.

◆ getNumberOfChildren()

unsigned int PeLib::ResourceChild::getNumberOfChildren ( ) const

Returns the node's number of children.

Returns the node's number of children.

◆ getOffsetToData()

std::uint32_t PeLib::ResourceChild::getOffsetToData ( ) const

Returns the OffsetToData value of the node.

Returns the OffsetToData value of the node.

Returns
OffsetToData value of the node.

◆ getOffsetToName()

std::uint32_t PeLib::ResourceChild::getOffsetToName ( ) const

Returns the Name value of the node.

Returns the Name value of the node.

Returns
Name value of the node.

◆ hasEqual() [1/2]

bool PeLib::ResourceChild::hasEqual ( const std::string &  name) const
inline

A comparison function for searching a resource element by its name.

◆ hasEqual() [2/2]

bool PeLib::ResourceChild::hasEqual ( std::uint32_t  id) const
inline

A comparison function for searching a resource element by its ID.

◆ isNamedResource()

bool PeLib::ResourceChild::isNamedResource ( ) const

Predicate that determines if a child is identified by name or by ID.

Returns true if the resource was given a name.

◆ operator<()

bool PeLib::ResourceChild::operator< ( const ResourceChild rc) const

Used for sorting a node's children.

The children of a resource must be ordered in a certain way. First come the named resources in sorted order, afterwards followed the unnamed resources in sorted order.

◆ operator=()

ResourceChild & PeLib::ResourceChild::operator= ( const ResourceChild rhs)

Makes a deep copy of a ResourceChild object.

◆ setName()

void PeLib::ResourceChild::setName ( const std::string &  strNewName)

Sets the name of the node.

Sets the name of the node.

Parameters
strNewNameNew node name.

◆ setNode()

void PeLib::ResourceChild::setNode ( ResourceElement node)

Sets a pointer to ResourceElement.

Sets ResourceElement associated with this ResourceChild. It can be either ResourceNode or ResourceLeaf.

Parameters
nodeResourceElement to associate with this ResourceChild.

◆ setOffsetToData()

void PeLib::ResourceChild::setOffsetToData ( std::uint32_t  dwNewOffset)

Sets the OffsetToData value of the node.

Sets the OffsetToData value of the node.

Parameters
dwNewOffsetOffsetToData value to set.

◆ setOffsetToName()

void PeLib::ResourceChild::setOffsetToName ( std::uint32_t  dwNewOffset)

Sets the Name value of the node.

Sets the Name value of the node.

Parameters
dwNewOffsetName value to set.

Friends And Related Function Documentation

◆ ResourceDirectory

◆ ResourceElement

friend class ResourceElement
friend

◆ ResourceLeaf

friend class ResourceLeaf
friend

◆ ResourceNode

friend class ResourceNode
friend

Member Data Documentation

◆ child

ResourceElement* PeLib::ResourceChild::child
private

A pointer to one of the node's child nodes.

◆ entry

PELIB_IMG_RES_DIR_ENTRY PeLib::ResourceChild::entry
private

Stores name and offset of a resource node.


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