OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TRegValue Class Reference

Encapsulates a value-data entry within one registration key. More...

#include <owl/registry.h>

Public Member Functions

 TRegValue (const TRegKey &key, LPCTSTR name)
 Creates a registry value object from the specified registry key and name.
 
 TRegValue (const TRegKey &key, const tstring &name)
 String-aware overload If the name is empty, the object will represent the key's default value.
 
 TRegValue (const TRegValueIterator &iter)
 Creates a registry object from the current location of the specified iterator.
 
Accessors
LPCTSTR GetName () const
 Returns a string identifying this value.
 
uint32 GetDataType () const
 Returns the type code for the data associated with this value.
 
uint32 GetDataSize () const
 Returns the size in bytes of the data associated with this value.
 
const uint8GetData () const
 Returns the data associated with this value.
 
 operator uint32 () const
 Returns the data associated with this value as a 32-bit unsigned integer.
 
 operator uint64 () const
 Returns the data associated with this value as a 64-bit unsigned integer.
 
 operator LPCTSTR () const
 Returns the data associated with this value as a null-terminated string.
 
Mutators
long Set (uint32 type, const uint8 *data, uint32 dataSize)
 Sets the data associated with this value.
 
long Set (uint32 value)
 Sets the data associated with this value.
 
long Set (uint64 value)
 Sets the data associated with this value.
 
long Set (LPCTSTR value)
 Sets the data associated with this value.
 
long Set (const tstring &value)
 Sets the data associated with this value.
 
TRegValueoperator= (uint32 value)
 Forwards to Set (uint32).
 
TRegValueoperator= (uint64 value)
 Forwards to Set (uint64).
 
TRegValueoperator= (LPCTSTR value)
 Forwards to Set (LPCTSTR).
 
TRegValueoperator= (const tstring &value)
 Forwards to Set (const tstring&).
 
long Delete ()
 Removes the value from its associated key, and clears the state of this object.
 

Detailed Description

Encapsulates a value-data entry within one registration key.

Definition at line 50 of file registry.h.

Constructor & Destructor Documentation

◆ TRegValue() [1/3]

owl::TRegValue::TRegValue ( const TRegKey & key,
LPCTSTR name )

Creates a registry value object from the specified registry key and name.

If the name is null or empty, the object will represent the key's default value.

Definition at line 879 of file registry.cpp.

◆ TRegValue() [2/3]

owl::TRegValue::TRegValue ( const TRegKey & key,
const tstring & name )

String-aware overload If the name is empty, the object will represent the key's default value.

Definition at line 890 of file registry.cpp.

◆ TRegValue() [3/3]

owl::TRegValue::TRegValue ( const TRegValueIterator & iter)
explicit

Creates a registry object from the current location of the specified iterator.

Definition at line 921 of file registry.cpp.

References _T, and owl::TRegKey::EnumValue().

Member Function Documentation

◆ Delete()

long owl::TRegValue::Delete ( )

Removes the value from its associated key, and clears the state of this object.

Definition at line 1133 of file registry.cpp.

References owl::TRegKey::DeleteValue().

◆ GetData()

const uint8 * owl::TRegValue::GetData ( ) const

Returns the data associated with this value.

Definition at line 998 of file registry.cpp.

◆ GetDataSize()

uint32 owl::TRegValue::GetDataSize ( ) const
inline

Returns the size in bytes of the data associated with this value.

Definition at line 1119 of file registry.h.

◆ GetDataType()

uint32 owl::TRegValue::GetDataType ( ) const
inline

Returns the type code for the data associated with this value.

Definition at line 1111 of file registry.h.

◆ GetName()

LPCTSTR owl::TRegValue::GetName ( ) const
inline

Returns a string identifying this value.

Definition at line 1103 of file registry.h.

◆ operator LPCTSTR()

owl::TRegValue::operator LPCTSTR ( ) const

Returns the data associated with this value as a null-terminated string.

Throws an exception if the value is of incompatible type or is otherwise invalid.

Definition at line 965 of file registry.cpp.

References _T, CHECK, and WARN.

◆ operator uint32()

owl::TRegValue::operator uint32 ( ) const

Returns the data associated with this value as a 32-bit unsigned integer.

Throws an exception if the value is of incompatible type.

Definition at line 937 of file registry.cpp.

References _T, and CHECK.

◆ operator uint64()

owl::TRegValue::operator uint64 ( ) const

Returns the data associated with this value as a 64-bit unsigned integer.

Throws an exception if the value is of incompatible type.

Definition at line 951 of file registry.cpp.

References _T, and CHECK.

◆ operator=() [1/4]

TRegValue & owl::TRegValue::operator= ( const tstring & v)

Forwards to Set (const tstring&).

Throws TXRegistry if data assignment fails.

Definition at line 1122 of file registry.cpp.

References _T, and Set().

◆ operator=() [2/4]

TRegValue & owl::TRegValue::operator= ( LPCTSTR v)

Forwards to Set (LPCTSTR).

Throws TXRegistry if data assignment fails.

Definition at line 1110 of file registry.cpp.

References _T, and Set().

◆ operator=() [3/4]

TRegValue & owl::TRegValue::operator= ( uint32 v)

Forwards to Set (uint32).

Throws TXRegistry if data assignment fails.

Definition at line 1086 of file registry.cpp.

References _T, and Set().

◆ operator=() [4/4]

TRegValue & owl::TRegValue::operator= ( uint64 v)

Forwards to Set (uint64).

Throws TXRegistry if data assignment fails.

Definition at line 1098 of file registry.cpp.

References _T, and Set().

◆ Set() [1/5]

long owl::TRegValue::Set ( const tstring & v)

Sets the data associated with this value.

If the string contains a terminating null, then it is stored in the registry as a multi-string, i.e. as a REG_MULTI_SZ value type, e.g. "multi\0string\0\0". Else, it is stored as a REG_SZ.

Definition at line 1072 of file registry.cpp.

References _T, and Set().

◆ Set() [2/5]

long owl::TRegValue::Set ( LPCTSTR v)

Sets the data associated with this value.

The type of the value is set to REG_SZ.

Definition at line 1059 of file registry.cpp.

References _tcslen, and Set().

◆ Set() [3/5]

long owl::TRegValue::Set ( uint32 type,
const uint8 * data,
uint32 dataSize )

Sets the data associated with this value.

'type' describes the type of the value. 'data' is the address of the data. 'size' specifies the length in characters.

Definition at line 1010 of file registry.cpp.

References owl::TRegKey::SetValue().

◆ Set() [4/5]

long owl::TRegValue::Set ( uint32 v)

Sets the data associated with this value.

The type of the value is set to REG_DWORD.

Definition at line 1035 of file registry.cpp.

References Set().

◆ Set() [5/5]

long owl::TRegValue::Set ( uint64 v)

Sets the data associated with this value.

The type of the value is set to REG_QWORD.

Definition at line 1047 of file registry.cpp.

References Set().


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