![]() |
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TResId encapsulates a Windows resource identifier. More...
#include <owl/wsyscls.h>
Public Types | |
typedef const T * | TPointer |
Public Member Functions | |
TResIdT () | |
Sets the identifier to 0. | |
TResIdT (TPointer id) | |
Encapsulates the given Windows resource identifier. | |
TResIdT (int id) | |
Encapsulates the given numerical Windows resource identifier. | |
TPointer | GetPointerRepresentation () const |
Returns the encapsulated pointer. | |
bool | IsInt () const |
Returns true if this resource identifier encodes an integer value. | |
bool | IsString () const |
Returns true if this resource identifier encodes a string pointer. | |
WORD | GetInt () const |
Returns the encapsulated numerical identifier, provided this resource identifier encodes a numerical identifier. | |
TPointer | GetString () const |
Returns the encapsulated string pointer, provided this resource identifier encodes a string pointer. | |
Friends | |
ipstream & | operator>> (ipstream &is, TResIdT &id) |
Extracts a TResIdT object from is (the given input stream), and copies it to id. | |
opstream & | operator<< (opstream &os, const TResIdT &id) |
Inserts the given TResIdT object (id) into the opstream (os). | |
std::ostream & | operator<< (std::ostream &os, const TResIdT &id) |
Formats and inserts the given TResId object (id) into the ostream (os). | |
TResId encapsulates a Windows resource identifier.
A Windows resource identifier is a pointer which either stores a pointer to a string that identifies the resource, or a numerical identifier encoded as a WORD in the lower bits. If the latter, then the higher bits are 0.
This class does not take ownership of the actual string that the resource identifier may point to.
typedef const T* owl::TResIdT< T >::TPointer |
|
inline |
|
inline |
|
inline |
Encapsulates the given numerical Windows resource identifier.
Note that a integer resource identifier is defined as a WORD, and thus only supports the identifier range 0 to 65535.
Definition at line 69 of file wsyscls.h.
References PRECONDITION.
|
inline |
Returns the encapsulated numerical identifier, provided this resource identifier encodes a numerical identifier.
Definition at line 92 of file wsyscls.h.
References PRECONDITION.
|
inline |
|
inline |
Returns the encapsulated string pointer, provided this resource identifier encodes a string pointer.
Definition at line 101 of file wsyscls.h.
References PRECONDITION.
|
inline |
|
inline |
Extracts a TResIdT object from is (the given input stream), and copies it to id.
Returns a reference to the resulting stream, allowing the usual chaining of >> operations.
NOTE: The caller is responsible for deallocating the memory if the returned TResId represents a resource string, i.e. when id.IsString() == true.