CResRef Class


Overview

Note

The CResRef class handles resource references (ResRef). Resource references are a maximum of 8 characters long

The structure used for this class is CResRef


Quick Reference

Quick Ref

void CResRef::CResRef(CString& sName)

void CResRef::CResRef(const char* pNewName)

void CResRef::CResRef(unsigned char* resRef)

void CResRef::CResRef()

void CResRef::CopyToString(CString& str)

int CResRef::EqualsSubstring(const char* pName)

char* CResRef::GetResRef()

void CResRef::GetResRef(unsigned char* resRef)

CString CResRef::GetResRefStr()

int CResRef::IsValid()

void CResRef::MakeUpper()

CResRef CResRef::operator=(CResRef& cResRef)

CResRef CResRef::operator=(CString& sName)

CResRef CResRef::operator=(const char* pName)

CResRef CResRef::operator=(unsigned char* resRef)

int CResRef::operator==(CString& sName)

int CResRef::operator==(const char* pName)

int CResRef::operator!=(CResRef& cResRef)

int CResRef::operator!=(CString& sName)

int CResRef::operator!=(const char* pName)

CResRef CResRef::operator+=(CString& sName)


Constructors

Name

Description

CResRef::CResRef

Constructs a CResRef object

CResRef::CResRef

Constructs a CResRef object

void CResRef::CResRef(CString& sName);

Parameters

  • CString& sName - string containing resource reference name

Remarks

Constructs a CResRef object


CResRef::CResRef

Constructs a CResRef object

void CResRef::CResRef(const char* pNewName);

Parameters

  • const char* pNewName - string containing resource reference name

Remarks

Constructs a CResRef object


CResRef::CResRef

Constructs a CResRef object

void CResRef::CResRef(unsigned char* resRef);

Parameters

  • unsigned char* resRef - string containing resource reference name

Remarks


Constructs a CResRef object

CResRef::CResRef

Constructs a CResRef object

void CResRef::CResRef();

Remarks

Constructs a CResRef object


Methods

Name

Description

CResRef::CopyToString

Copy resource reference to a string

CResRef::EqualsSubstring

Determines if specified substring is in the resource reference

CResRef::GetResRef

Returns the resource reference

CResRef::GetResRefStr

Returns the resource reference as a string

CResRef::IsValid

Determines if the resource reference is valid

CResRef::MakeUpper

Converts the resource reference characters to uppercase


CResRef::CopyToString

Copy resource reference to a string

void CResRef::CopyToString(CString& str);

Parameters

  • CString& str - address of string to copy resource reference to

Remarks


CResRef::EqualsSubstring

Determines if specified substring is within the resource reference

int CResRef::EqualsSubstring(const char* pName);

Parameters

  • const char* pName - pointer to substring to compare against resource reference

Return Value

Returns an int value representing 1 true, or 0 false otherwise

Remarks


CResRef::GetResRef

Returns the resource reference

char\* CResRef::GetResRef();

Return Value

Returns char* - a pointer to the resource reference characters

Remarks

Resource references are a maximum of 8 characters long


CResRef::GetResRef

Returns the resource reference

void CResRef::GetResRef(unsigned char* resRef);

Parameters

  • unsigned char* resRef - returns the resource reference characters into the buffer pointed to by resRef

Return Value

Returns

Remarks

Resource references are a maximum of 8 characters long

Ensure the buffer pointed to by resRef has enough space


CResRef::GetResRefStr

Returns the resource reference as a string

CString CResRef::GetResRefStr();

Return Value

Returns CString

Remarks

Similar to CResRef::GetResRef except returns the resource reference into a CString object


CResRef::IsValid

Determines if the resource reference is valid and that the resource exists

int CResRef::IsValid();

Return Value

Returns an int value representing 1 true, or 0 false otherwise

Remarks


CResRef::MakeUpper

Converts the resource reference characters to uppercase

void CResRef::MakeUpper();

Remarks

gsack01 would be converted to GSACK01


Operators

Name

Description

CResRef::operator=

Assign a resource reference

CResRef::operator=

Assign a resource reference

CResRef::operator=

Assign a resource reference

CResRef::operator=

Assign a resource reference

CResRef::operator==

Comparison of resource reference

CResRef::operator==

Comparison of resource reference

CResRef::operator!=

Comparison of resource reference

CResRef::operator!=

Comparison of resource reference

CResRef::operator!=

Comparison of resource reference

CResRef::operator+=

Add and assign


CResRef::operator=

Assign a resource reference to this resource reference object

CResRef::operator=(CResRef& cResRef);

Parameters

  • CResRef& cResRef - address of variable containing the resource reference object

Return Value

Returns CResRef

Remarks


CResRef::operator=

Assign a resource reference to this resource reference object

CResRef::operator=(CString& sName);

Parameters

  • CString& sName - address of variable containing a string of the resource reference name

Return Value

Returns CResRef

Remarks


CResRef::operator=

Assign a resource reference to this resource reference object

CResRef::operator=(const char* pName);

Parameters

  • const char* pName - pointer to a string containing the resource reference name

Return Value

Returns CResRef

Remarks


CResRef::operator=

Assign a resource reference to this resource reference object

CResRef::operator=(unsigned char* resRef);

Parameters

  • unsigned char* resRef - pointer to a string containing the resource reference name

Return Value

Returns CResRef

Remarks


CResRef::operator==

Comparison of resource reference name

int CResRef::operator==(CString& sName);

Parameters

  • CString& sName - address of variable containing string of resource reference name to compare

Return Value

Returns an int value representing 1 true if the comparison matches, or 0 false otherwise

Remarks


CResRef::operator==

Comparison of resource reference name

int CResRef::operator==(const char* pName);

Parameters

  • const char* pName - pointer to string containing resource reference name to compare

Return Value

Returns an int value representing 1 true if the comparison matches, or 0 false otherwise

Remarks


CResRef::operator!=

Comparison of resource reference object

int CResRef::operator!=(CResRef& cResRef);

Parameters

  • CResRef& cResRef - address of variable containing resource reference object to compare

Return Value

Returns an int value representing 1 true if the comparison does not match, or 0 false if it does match

Remarks


CResRef::operator!=

Comparison of resource reference name

int CResRef::operator!=(CString& sName);

Parameters

  • CString& sName - address of variable containing string of resource reference name to compare

Return Value

Returns an int value representing 1 true if the comparison does not match, or 0 false if it does match

Remarks


CResRef::operator!=

Comparison of resource reference name

int CResRef::operator!=(const char* pName);

Parameters

  • const char* pName - pointer to string containing resource reference name to compare

Return Value

Returns an int value representing 1 true if the comparison does not match, or 0 false if it does match

Remarks


CResRef::operator+=

Add and assign

CResRef CResRef::operator+=(CString& sName);

Parameters

  • CString& sName - address of variable containing string of resource reference name

Return Value

Returns CResRef

Remarks