CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
Microsoft::Win32::RegistryKey Class Reference

API to manipulate registry values. Support is very limited and Windows-only. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument. More...

#include <registry.h>

Inherits System::Object.

Public Member Functions

virtual ~RegistryKey () override
 Destructor. More...
 
System::SharedPtr< SafeRegistryHandle > get_Handle ()
 Gets raw handle of registry key. Not implemented. More...
 
System::String get_Name ()
 Gets name of registry key. Not implemented. More...
 
int get_SubKeyCount ()
 Gets number of subkeys. Not implemented. More...
 
int get_ValueCount ()
 Gets number of values. Not implemented. More...
 
RegistryView get_View ()
 Gets view of registry key. Not implemented. More...
 
void Close ()
 Closes registry key. Not implemented. More...
 
System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey)
 Creates subkey under current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck)
 Creates subkey under current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Creates subkey under current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
 Creates subkey under current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyCreateSubKey (const System::String &subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions registryOptions, const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Creates subkey under current key. Not implemented. More...
 
void DeleteSubKey (const System::String &subkey)
 Deletes subkey under current key. Not implemented. More...
 
void DeleteSubKey (const System::String &subkey, bool throwOnMissingSubKey)
 Deletes subkey under current key. Not implemented. More...
 
void DeleteSubKeyTree (const System::String &subkey)
 Deletes subkey tree under current key. Not implemented. More...
 
void DeleteSubKeyTree (const System::String &subkey, bool throwOnMissingSubKey)
 Deletes subkey tree under current key. Not implemented. More...
 
void DeleteValue (const System::String &name)
 Deletes value of current key. Not implemented. More...
 
void DeleteValue (const System::String &name, bool throwOnMissingValue)
 Deletes value of current key. Not implemented. More...
 
void Dispose ()
 Frees handles associated with key. Not implemented. More...
 
void Flush ()
 Writes all attributes of key to registry. Not implemented. More...
 
System::SharedPtr< RegistrySecurity > GetAccessControl ()
 Gets access control object associated with key. Not implemented. More...
 
System::SharedPtr< RegistrySecurity > GetAccessControl (AccessControlSections includeSections)
 Gets access control object associated with key. Not implemented. More...
 
System::ArrayPtr< System::StringGetSubKeyNames ()
 Enumerates subkeys. Not implemented. More...
 
System::SharedPtr< System::ObjectGetValue (const System::String &valueName)
 Gets key value. Windows only. More...
 
System::SharedPtr< System::ObjectGetValue (const System::String &name, const System::SharedPtr< System::Object > &defaultValue)
 Gets key value. Not implemented. More...
 
System::SharedPtr< System::ObjectGetValue (const System::String &name, const System::SharedPtr< System::Object > &defaultValue, RegistryValueOptions options)
 Gets key value. Not implemented. More...
 
RegistryValueKind GetValueKind (const System::String &name)
 Gets key value type. Not implemented. More...
 
System::ArrayPtr< System::StringGetValueNames ()
 Gets list of value names under current key. More...
 
System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name)
 Opens subkey of current key. More...
 
System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, RegistryKeyPermissionCheck permissionCheck)
 Opens subkey of current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, bool writable)
 Opens subkey of current key. Not implemented. More...
 
System::SharedPtr< RegistryKeyOpenSubKey (const System::String &name, RegistryKeyPermissionCheck permissionCheck, RegistryRights rights)
 Opens subkey of current key. Not implemented. More...
 
void SetAccessControl (const System::SharedPtr< RegistrySecurity > &registrySecurity)
 Sets access control value. Not implemented. More...
 
void SetValue (const System::String &name, const System::SharedPtr< System::Object > &value)
 Sets registry value. Not implemented. More...
 
void SetValue (const System::String &name, const System::SharedPtr< System::Object > &value, RegistryValueKind valueKind)
 Sets registry value. Not implemented. More...
 
System::String ToString () const override
 Converts key to string. Not implemented. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static System::SharedPtr< RegistryKeyFromHandle (const System::SharedPtr< SafeRegistryHandle > &handle)
 Opens key from handle. Not implemented. More...
 
static System::SharedPtr< RegistryKeyFromHandle (const System::SharedPtr< SafeRegistryHandle > &handle, RegistryView view)
 Opens key from handle. Not implemented. More...
 
static System::SharedPtr< RegistryKeyOpenBaseKey (RegistryHive hKey, RegistryView view)
 Opens base key. Not implemented. More...
 
static System::SharedPtr< RegistryKeyOpenRemoteBaseKey (RegistryHive hKey, const System::String &machineName)
 Opens base key on remote host. Not implemented. More...
 
static System::SharedPtr< RegistryKeyOpenRemoteBaseKey (RegistryHive hKey, const System::String &machineName, RegistryView view)
 Opens base key on remote host. Not implemented. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

API to manipulate registry values. Support is very limited and Windows-only. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Constructor & Destructor Documentation

◆ ~RegistryKey()

virtual Microsoft::Win32::RegistryKey::~RegistryKey ( )
overridevirtual

Destructor.

Member Function Documentation

◆ Close()

void Microsoft::Win32::RegistryKey::Close ( )

Closes registry key. Not implemented.

◆ CreateSubKey() [1/5]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [2/5]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [3/5]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
const System::SharedPtr< RegistrySecurity > &  registrySecurity 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [4/5]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
RegistryOptions  options 
)

Creates subkey under current key. Not implemented.

◆ CreateSubKey() [5/5]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::CreateSubKey ( const System::String subkey,
RegistryKeyPermissionCheck  permissionCheck,
RegistryOptions  registryOptions,
const System::SharedPtr< RegistrySecurity > &  registrySecurity 
)

Creates subkey under current key. Not implemented.

◆ DeleteSubKey() [1/2]

void Microsoft::Win32::RegistryKey::DeleteSubKey ( const System::String subkey)

Deletes subkey under current key. Not implemented.

◆ DeleteSubKey() [2/2]

void Microsoft::Win32::RegistryKey::DeleteSubKey ( const System::String subkey,
bool  throwOnMissingSubKey 
)

Deletes subkey under current key. Not implemented.

◆ DeleteSubKeyTree() [1/2]

void Microsoft::Win32::RegistryKey::DeleteSubKeyTree ( const System::String subkey)

Deletes subkey tree under current key. Not implemented.

◆ DeleteSubKeyTree() [2/2]

void Microsoft::Win32::RegistryKey::DeleteSubKeyTree ( const System::String subkey,
bool  throwOnMissingSubKey 
)

Deletes subkey tree under current key. Not implemented.

◆ DeleteValue() [1/2]

void Microsoft::Win32::RegistryKey::DeleteValue ( const System::String name)

Deletes value of current key. Not implemented.

◆ DeleteValue() [2/2]

void Microsoft::Win32::RegistryKey::DeleteValue ( const System::String name,
bool  throwOnMissingValue 
)

Deletes value of current key. Not implemented.

◆ Dispose()

void Microsoft::Win32::RegistryKey::Dispose ( )

Frees handles associated with key. Not implemented.

◆ Flush()

void Microsoft::Win32::RegistryKey::Flush ( )

Writes all attributes of key to registry. Not implemented.

◆ FromHandle() [1/2]

static System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::FromHandle ( const System::SharedPtr< SafeRegistryHandle > &  handle)
static

Opens key from handle. Not implemented.

◆ FromHandle() [2/2]

static System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::FromHandle ( const System::SharedPtr< SafeRegistryHandle > &  handle,
RegistryView  view 
)
static

Opens key from handle. Not implemented.

◆ get_Handle()

System::SharedPtr< SafeRegistryHandle > Microsoft::Win32::RegistryKey::get_Handle ( )

Gets raw handle of registry key. Not implemented.

◆ get_Name()

System::String Microsoft::Win32::RegistryKey::get_Name ( )

Gets name of registry key. Not implemented.

◆ get_SubKeyCount()

int Microsoft::Win32::RegistryKey::get_SubKeyCount ( )

Gets number of subkeys. Not implemented.

◆ get_ValueCount()

int Microsoft::Win32::RegistryKey::get_ValueCount ( )

Gets number of values. Not implemented.

◆ get_View()

RegistryView Microsoft::Win32::RegistryKey::get_View ( )

Gets view of registry key. Not implemented.

◆ GetAccessControl() [1/2]

System::SharedPtr< RegistrySecurity > Microsoft::Win32::RegistryKey::GetAccessControl ( )

Gets access control object associated with key. Not implemented.

◆ GetAccessControl() [2/2]

System::SharedPtr< RegistrySecurity > Microsoft::Win32::RegistryKey::GetAccessControl ( AccessControlSections  includeSections)

Gets access control object associated with key. Not implemented.

◆ GetSubKeyNames()

System::ArrayPtr< System::String > Microsoft::Win32::RegistryKey::GetSubKeyNames ( )

Enumerates subkeys. Not implemented.

◆ GetValue() [1/3]

System::SharedPtr< System::Object > Microsoft::Win32::RegistryKey::GetValue ( const System::String name,
const System::SharedPtr< System::Object > &  defaultValue 
)

Gets key value. Not implemented.

◆ GetValue() [2/3]

System::SharedPtr< System::Object > Microsoft::Win32::RegistryKey::GetValue ( const System::String name,
const System::SharedPtr< System::Object > &  defaultValue,
RegistryValueOptions  options 
)

Gets key value. Not implemented.

◆ GetValue() [3/3]

System::SharedPtr< System::Object > Microsoft::Win32::RegistryKey::GetValue ( const System::String valueName)

Gets key value. Windows only.

Parameters
valueNameName of the value under current key.
Returns
Boxed value of key.

◆ GetValueKind()

RegistryValueKind Microsoft::Win32::RegistryKey::GetValueKind ( const System::String name)

Gets key value type. Not implemented.

◆ GetValueNames()

System::ArrayPtr< System::String > Microsoft::Win32::RegistryKey::GetValueNames ( )

Gets list of value names under current key.

Returns
List of string names.

◆ OpenBaseKey()

static System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenBaseKey ( RegistryHive  hKey,
RegistryView  view 
)
static

Opens base key. Not implemented.

◆ OpenRemoteBaseKey() [1/2]

static System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenRemoteBaseKey ( RegistryHive  hKey,
const System::String machineName 
)
static

Opens base key on remote host. Not implemented.

◆ OpenRemoteBaseKey() [2/2]

static System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenRemoteBaseKey ( RegistryHive  hKey,
const System::String machineName,
RegistryView  view 
)
static

Opens base key on remote host. Not implemented.

◆ OpenSubKey() [1/4]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name)

Opens subkey of current key.

Parameters
nameName of the subkey.
Returns
RegistryKey object associated with subkey.

◆ OpenSubKey() [2/4]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
bool  writable 
)

Opens subkey of current key. Not implemented.

◆ OpenSubKey() [3/4]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
RegistryKeyPermissionCheck  permissionCheck 
)

Opens subkey of current key. Not implemented.

◆ OpenSubKey() [4/4]

System::SharedPtr< RegistryKey > Microsoft::Win32::RegistryKey::OpenSubKey ( const System::String name,
RegistryKeyPermissionCheck  permissionCheck,
RegistryRights  rights 
)

Opens subkey of current key. Not implemented.

◆ SetAccessControl()

void Microsoft::Win32::RegistryKey::SetAccessControl ( const System::SharedPtr< RegistrySecurity > &  registrySecurity)

Sets access control value. Not implemented.

◆ SetValue() [1/2]

void Microsoft::Win32::RegistryKey::SetValue ( const System::String name,
const System::SharedPtr< System::Object > &  value 
)

Sets registry value. Not implemented.

◆ SetValue() [2/2]

void Microsoft::Win32::RegistryKey::SetValue ( const System::String name,
const System::SharedPtr< System::Object > &  value,
RegistryValueKind  valueKind 
)

Sets registry value. Not implemented.

◆ ToString()

System::String Microsoft::Win32::RegistryKey::ToString ( ) const
overridevirtual

Converts key to string. Not implemented.

Reimplemented from System::Object.