OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TResIdT< T > Class Template Reference

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

ipstreamoperator>> (ipstream &is, TResIdT &id)
 Extracts a TResIdT object from is (the given input stream), and copies it to id.
 
opstreamoperator<< (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).
 

Detailed Description

template<class T>
class owl::TResIdT< T >

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.

Definition at line 48 of file wsyscls.h.

Member Typedef Documentation

◆ TPointer

template<class T >
typedef const T* owl::TResIdT< T >::TPointer

Definition at line 51 of file wsyscls.h.

Constructor & Destructor Documentation

◆ TResIdT() [1/3]

template<class T >
owl::TResIdT< T >::TResIdT ( )
inline

Sets the identifier to 0.

Definition at line 56 of file wsyscls.h.

◆ TResIdT() [2/3]

template<class T >
owl::TResIdT< T >::TResIdT ( TPointer id)
inline

Encapsulates the given Windows resource identifier.

Note: The given pointer may actually encode a WORD in the lower bits.

Definition at line 62 of file wsyscls.h.

◆ TResIdT() [3/3]

template<class T >
owl::TResIdT< T >::TResIdT ( int id)
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.

Member Function Documentation

◆ GetInt()

template<class T >
WORD owl::TResIdT< T >::GetInt ( ) const
inline

Returns the encapsulated numerical identifier, provided this resource identifier encodes a numerical identifier.

Definition at line 92 of file wsyscls.h.

References PRECONDITION.

◆ GetPointerRepresentation()

template<class T >
TPointer owl::TResIdT< T >::GetPointerRepresentation ( ) const
inline

Returns the encapsulated pointer.

Definition at line 76 of file wsyscls.h.

◆ GetString()

template<class T >
TPointer owl::TResIdT< T >::GetString ( ) const
inline

Returns the encapsulated string pointer, provided this resource identifier encodes a string pointer.

Definition at line 101 of file wsyscls.h.

References PRECONDITION.

◆ IsInt()

template<class T >
bool owl::TResIdT< T >::IsInt ( ) const
inline

Returns true if this resource identifier encodes an integer value.

Definition at line 81 of file wsyscls.h.

◆ IsString()

template<class T >
bool owl::TResIdT< T >::IsString ( ) const
inline

Returns true if this resource identifier encodes a string pointer.

Definition at line 86 of file wsyscls.h.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

template<class T >
opstream & operator<< ( opstream & os,
const TResIdT< T > & id )
friend

Inserts the given TResIdT object (id) into the opstream (os).

Returns a reference to the resulting stream, allowing the usual chaining of << operations.

Definition at line 141 of file wsyscls.h.

◆ operator<< [2/2]

template<class T >
std::ostream & operator<< ( std::ostream & os,
const TResIdT< T > & id )
friend

Formats and inserts the given TResId object (id) into the ostream (os).

Returns a reference to the resulting stream, allowing the usual chaining of << operations.

Definition at line 163 of file wsyscls.h.

◆ operator>>

template<class T >
ipstream & operator>> ( ipstream & is,
TResIdT< T > & id )
friend

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.

Definition at line 117 of file wsyscls.h.


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