Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

ResourceNode Class Reference

ResourceNodes represent the nodes in the resource tree. More...

#include <ResourceDirectory.h>

Inheritance diagram for ResourceNode:

Inheritance graph
[legend]
Collaboration diagram for ResourceNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void addChild ()
 Adds another child to node.

dword getCharacteristics () const
 Returns the node's Characteristics value.

ResourceElementgetChild (unsigned int uiIndex)
 Returns a node's child.

std::string getChildName (unsigned int uiIndex) const
 Returns the name of one of the node's children.

word getMajorVersion () const
 Returns the node's MajorVersion value.

word getMinorVersion () const
 Returns the node's MinorVersion value.

unsigned int getNumberOfChildren () const
 Returns the node's number of children.

word getNumberOfIdEntries () const
 Returns the node's NumberOfIdEntries value.

word getNumberOfNamedEntries () const
 Returns the node's NumberOfNamedEntries value.

dword getOffsetToChildData (unsigned int uiIndex) const
 Returns the OffsetToData value of one of the node's children.

dword getOffsetToChildName (unsigned int uiIndex) const
 Returns the Name value of one of the node's children.

dword getTimeDateStamp () const
 Returns the node's TimeDateStamp value.

bool isLeaf () const
 Indicates if the resource element is a leaf or a node.

void makeValid ()
 Corrects erroneous valeus in the ResourceNode.

void removeChild (unsigned int uiIndex)
 Removes a node's child.

void setCharacteristics (dword value)
 Sets the node's Characteristics value.

void setChildName (unsigned int uiIndex, const std::string &strNewName)
 Sets the name of one of the node's children.

void setMajorVersion (word value)
 Sets the node's MajorVersion value.

void setMinorVersion (word value)
 Sets the node's MinorVersion value.

void setNumberOfIdEntries (word value)
 Sets the node's NumberOfIdEntries value.

void setNumberOfNamedEntries (word value)
 Sets the node's NumberOfNamedEntries value.

void setOffsetToChildData (unsigned int uiIndex, dword dwNewOffset)
 Sets the OffsetToData value of one of the node's children.

void setOffsetToChildName (unsigned int uiIndex, dword dwNewOffset)
 Sets the Name value of one of the node's children.

void setTimeDateStamp (dword value)
 Sets the node's TimeDateStamp value.


Protected Member Functions

int read (InputBuffer &inpBuffer, unsigned int uiOffset, unsigned int rva)
 Reads the next resource node.

void rebuild (OutputBuffer &, unsigned int &uiOffset, unsigned int uiRva, const std::string &) const
 Writes the next resource node into the OutputBuffer.


Private Attributes

std::vector< ResourceChildchildren
 The node's children.

PELIB_IMAGE_RESOURCE_DIRECTORY header
 The node's header. Equivalent to IMAGE_RESOURCE_DIRECTORY from the Win32 API.


Detailed Description

ResourceNodes represent the nodes in the resource tree.


Member Function Documentation

void addChild  ) 
 

Adds another child to node.

Adds another child to the current node.

dword getCharacteristics  )  const
 

Returns the node's Characteristics value.

Returns the Characteristics value of the node.

Returns:
Characteristics value of the node.

ResourceElement * getChild unsigned int  uiIndex  ) 
 

Returns a node's child.

Returns a node's child.

Parameters:
uiIndex Index of the child.
Returns:
The child identified by uiIndex. This child can be either a ResourceNode or a ResourceLeaf.

std::string getChildName unsigned int  uiIndex  )  const
 

Returns the name of one of the node's children.

Returns the name of a child.

Parameters:
uiIndex Index of the child.
Returns:
Either the name of the specified child or an empty string.

word getMajorVersion  )  const
 

Returns the node's MajorVersion value.

Returns the MajorVersion value of the node.

Returns:
MajorVersion value of the node.

word getMinorVersion  )  const
 

Returns the node's MinorVersion value.

Returns the MinorVersion value of the node.

Returns:
MinorVersion value of the node.

unsigned int getNumberOfChildren  )  const
 

Returns the node's number of children.

Returns the number of children of the current node. Note that this number is the number of defined children, not the value from the header.

Returns:
Number of node's children.

word getNumberOfIdEntries  )  const
 

Returns the node's NumberOfIdEntries value.

Returns the NumberOfIdEntries value of the node.

Returns:
NumberOfIdEntries value of the node.

word getNumberOfNamedEntries  )  const
 

Returns the node's NumberOfNamedEntries value.

Returns the NumberOfNamedEntries value of the node.

Returns:
NumberOfNamedEntries value of the node.

dword getOffsetToChildData unsigned int  uiIndex  )  const
 

Returns the OffsetToData value of one of the node's children.

Returns the OffsetToData value of a child.

Parameters:
uiIndex Index of the child.
Returns:
OffsetToData value of a child.

dword getOffsetToChildName unsigned int  uiIndex  )  const
 

Returns the Name value of one of the node's children.

Returns the Name value of a child.

Parameters:
uiIndex Index of the child.
Returns:
Name value of a child.

dword getTimeDateStamp  )  const
 

Returns the node's TimeDateStamp value.

Returns the TimeDateStamp value of the node.

Returns:
TimeDateStamp value of the node.

bool isLeaf  )  const [virtual]
 

Indicates if the resource element is a leaf or a node.

Checks if a ResourceElement is a leaf or not.

Returns:
Always returns false.

Implements ResourceElement.

void makeValid  )  [virtual]
 

Corrects erroneous valeus in the ResourceNode.

Sorts the node's children and corrects the node's header.

Implements ResourceElement.

int read InputBuffer &  inpBuffer,
unsigned int  uiOffset,
unsigned int  uiRva
[protected, virtual]
 

Reads the next resource node.

Reads the next resource node from the InputBuffer.

Parameters:
inpBuffer An InputBuffer that holds the complete resource directory.
uiOffset Offset of the resource node that's to be read.
uiRva RVA of the beginning of the resource directory.
pad Something I need for debugging. Will be removed soon.

Implements ResourceElement.

Here is the call graph for this function:

void rebuild OutputBuffer &  obBuffer,
unsigned int &  uiOffset,
unsigned int  uiRva,
const std::string &  pad
const [protected, virtual]
 

Writes the next resource node into the OutputBuffer.

Rebuilds the current resource node.

Parameters:
obBuffer OutputBuffer where the rebuilt resource node is stored.
uiOffset Offset of the resource node inside the resource directory.
uiRva RVA of the resource directory.
pad Used for debugging.

Implements ResourceElement.

void removeChild unsigned int  uiIndex  ) 
 

Removes a node's child.

Removes a child from the current node.

Parameters:
uiIndex Index of the child.

void setCharacteristics dword  value  ) 
 

Sets the node's Characteristics value.

Sets the Characteristics value of the node.

Parameters:
value New Characteristics value of the node.

void setChildName unsigned int  uiIndex,
const std::string &  strNewName
 

Sets the name of one of the node's children.

Sets the name of a child.

Parameters:
uiIndex Index of the child.
strNewName New name of the resource.

void setMajorVersion word  value  ) 
 

Sets the node's MajorVersion value.

Sets the MajorVersion value of the node.

Parameters:
value New MajorVersion value of the node.

void setMinorVersion word  value  ) 
 

Sets the node's MinorVersion value.

Sets the MinorVersion value of the node.

Parameters:
value New MinorVersion value of the node.

void setNumberOfIdEntries word  value  ) 
 

Sets the node's NumberOfIdEntries value.

Sets the NumberOfIdEntries value of the node.

Parameters:
value New NumberOfIdEntries value of the node.

void setNumberOfNamedEntries word  value  ) 
 

Sets the node's NumberOfNamedEntries value.

Sets the NumberOfNamedEntries value of the node.

Parameters:
value New NumberOfNamedEntries value of the node.

void setOffsetToChildData unsigned int  uiIndex,
dword  dwNewOffset
 

Sets the OffsetToData value of one of the node's children.

Sets the OffsetToData value of a child.

Parameters:
uiIndex Index of the child.
dwNewOffset New OffsetToData value of the resource.

void setOffsetToChildName unsigned int  uiIndex,
dword  dwNewOffset
 

Sets the Name value of one of the node's children.

Sets the Name value of a child.

Parameters:
uiIndex Index of the child.
dwNewOffset New Name value of the resource.

void setTimeDateStamp dword  value  ) 
 

Sets the node's TimeDateStamp value.

Sets the TimeDateStamp value of the node.

Parameters:
value New TimeDateStamp value of the node.


The documentation for this class was generated from the following files:
Generated on Mon Jan 17 20:50:21 2005 for PeLib by doxygen 1.3.7