13#if !defined(OWL_REGISTRY_H)
17#if defined(BI_HAS_PRAGMA_ONCE)
57#if defined(BI_COMP_BORLANDC)
76 operator LPCTSTR()
const;
85 long Set(LPCTSTR value);
102 mutable std::vector<uint8> Data;
105 long QueryTypeAndSize();
106 void RetrieveOnDemand()
const;
131 static auto GetClassesRoot() ->
TRegKey&;
132 static auto GetClassesRootClsid() ->
TRegKey&;
133 static auto GetCurrentConfig() ->
TRegKey&;
134 static auto GetCurrentUser() ->
TRegKey&;
135 static auto GetLocalMachine() ->
TRegKey&;
136 static auto GetPerformanceData() ->
TRegKey&;
137 static auto GetUsers() ->
TRegKey&;
141#if defined(OWL5_COMPAT)
146 static auto ClassesRoot() ->
TRegKey& {
return GetClassesRoot(); }
147 static auto ClassesRootClsid() -> TRegKey& {
return GetClassesRootClsid(); }
148 static auto CurrentConfig() -> TRegKey& {
return GetCurrentConfig(); }
149 static auto CurrentUser() -> TRegKey& {
return GetCurrentUser(); }
150 static auto LocalMachine() -> TRegKey& {
return GetLocalMachine(); }
151 static auto PerformanceData() -> TRegKey& {
return GetPerformanceData(); }
152 static auto Users() -> TRegKey& {
return GetUsers(); }
158 TRegKey(THandle baseKey, tstring keyName, REGSAM samDesired = KEY_ALL_ACCESS, TCreateOK createOK = CreateOK);
159 TRegKey(THandle baseKey, LPCTSTR keyName, REGSAM samDesired = KEY_ALL_ACCESS, TCreateOK createOK = CreateOK);
160 explicit TRegKey(
const TRegKeyIterator& iter, REGSAM samDesired = KEY_ALL_ACCESS);
161 TRegKey(THandle aliasKey,
bool shouldClose, tstring keyName);
162 explicit TRegKey(THandle aliasKey,
bool shouldClose =
false, LPCTSTR keyName =
nullptr);
164 TRegKey(TRegKey&&) noexcept;
168#if defined(BI_COMP_BORLANDC)
182 long DeleteKey(LPCTSTR subKeyName);
184 {
return DeleteKey(subKeyName.c_str()); }
186 long NukeKey(LPCTSTR subKeyName);
188 {
return NukeKey(subKeyName.c_str()); }
209 auto IsValid()
const noexcept -> bool;
211 auto GetControl()
const -> SECURITY_DESCRIPTOR_CONTROL;
213 auto GetDacl()
const -> std::optional<PACL>;
218 auto GetSacl()
const -> std::optional<PACL>;
220 void Initialize(DWORD revision = SECURITY_DESCRIPTOR_REVISION);
226 void SetDacl(PACL dacl,
bool daclDefaulted =
false);
227 void SetGroup(PSID group,
bool groupDefaulted =
false);
228 void SetOwner(PSID owner,
bool ownerDefaulted =
false);
230 void SetSacl(PACL sacl,
bool saclDefaulted =
false);
235 auto GetData() noexcept -> SECURITY_DESCRIPTOR* {
return reinterpret_cast<SECURITY_DESCRIPTOR*
>(Data.data()); }
236 auto GetData() const noexcept -> const SECURITY_DESCRIPTOR* {
return reinterpret_cast<const SECURITY_DESCRIPTOR*
>(Data.data()); }
237 auto GetDataSize() const noexcept ->
int {
return static_cast<int>(Data.size()); }
264 std::vector<std::byte> Data;
267 auto GetSecurity(SECURITY_INFORMATION infoRequested, PSECURITY_DESCRIPTOR secDesc, DWORD* secDescSize)
const -> long;
268 auto GetSecurity(SECURITY_INFORMATION infoRequested)
const -> TSecurityDescriptor;
269 auto SetSecurity(SECURITY_INFORMATION infoToSet, PSECURITY_DESCRIPTOR secDesc)
const -> long;
270 void SetSecurity(SECURITY_INFORMATION infoToSet,
const TSecurityDescriptor& s)
const;
276 long Save(LPCTSTR fileName);
278 {
return Save(fileName.c_str()); }
280 long LoadKey(LPCTSTR subKeyName, LPCTSTR fileName);
282 {
return LoadKey(subKeyName.c_str(), fileName.c_str()); }
284 long ReplaceKey(LPCTSTR subKeyName, LPCTSTR newFileName, LPCTSTR oldFileName);
286 {
return ReplaceKey(subKeyName.c_str(), newFileName.c_str(), oldFileName.c_str()); }
288 long Restore(LPCTSTR fileName,
uint32 options = 0);
290 {
return Restore(fileName.c_str(), options); }
292 long UnLoadKey(LPCTSTR subKeyName);
294 {
return UnLoadKey(subKeyName.c_str()); }
296 long QueryInfo(LPTSTR class_, DWORD* classSize,
297 DWORD* subkeyCount, DWORD* maxSubkeyNameSize, DWORD* maxSubkeyClassSize,
298 DWORD* valueCount, DWORD* maxValueNameSize, DWORD* maxValueDataSize,
299 DWORD* securityDescriptorSize, PFILETIME lastWriteTime)
const;
335 template <typename T>
338 static_assert(!std::is_pointer_v<T>,
"Return type can not be pointer.");
340 return v ?
static_cast<T
>(*v) : defaultValue;
346 long EnumKey(
int index, LPTSTR subKeyName,
int subKeyNameSize)
const;
348#if defined(OWL5_COMPAT)
352 long SetDefValue(LPCTSTR subkeyName,
uint32 type,
353 LPCTSTR data,
uint32 dataSize);
355 {
return SetDefValue(subkeyName.c_str(), type, data.c_str(), dataSize); }
357 long QueryDefValue(LPCTSTR subkeyName, LPTSTR data,
358 uint32* dataSize)
const;
359 long QueryDefValue(
const tstring& subkeyName, LPTSTR data, uint32* dataSize)
const
360 {
return QueryDefValue(subkeyName.c_str(), data, dataSize); }
366 long SetValue(LPCTSTR valName, uint32 type,
const uint8* data, uint32 dataSize)
const;
368 {
return SetValue(valName.c_str(), type, data, dataSize); }
370 long SetValue(LPCTSTR valName,
uint32 data)
const;
372 {
return SetValue(valName.c_str(), data); }
374 long SetValue(LPCTSTR valName,
const tstring& value)
const;
376 {
return SetValue(valName.c_str(), value); }
378 long QueryValue(LPCTSTR valName,
uint32* type,
uint8* data,
uint32* dataSize)
const;
380 {
return QueryValue(valName.c_str(), type, data, dataSize); }
382 long DeleteValue(LPCTSTR valName)
const;
389 long EnumValue(
int index, LPTSTR valueName,
uint32& valueNameSize,
uint32* type =
nullptr,
uint8* data =
nullptr,
uint32* dataSize =
nullptr)
const;
413 uint32 operator [](
int index);
439 uint32 operator [](
int index);
460 :
TXOwl{context}, KeyName{key.GetName()}, ErrorCode{errorCode}
464 :
TXOwl{context}, KeyName{std::move(keyName)}, ErrorCode{errorCode}
537 {
return Lookup(key.c_str(), lang); }
543 LPCTSTR operator[](LPCSTR key);
583#define BEGIN_REGISTRATION(regname) \
584 extern TRegItem regname##_list[];\
585 extern TRegFormatHeap __regHeap;\
586 TRegList regname(regname##_list);\
587 TRegItem regname##_list[] = {
589#define END_REGISTRATION {0,{0}} };
591#define REGDATA(var,val) {#var, {val}},
592#define REGXLAT(var,val) {#var, {AUTOLANG_XLAT val}},
593#define REGITEM(key,val) {" " key, {val}},
594#define REGFORMAT(i,f,a,t,d) {"format" #i,{TRegItem::RegFormat(f,a,t,d,__regHeap)}},
595#define REGSTATUS(a,f) {"aspect" #a, {TRegItem::RegFlags(f,__regHeap)}},
596#define REGVERBOPT(v,mf,sf) {#v "opt",{TRegItem::RegVerbOpt(mf,sf,__regHeap)}},
597#define REGICON(i) {"iconindex",{TRegItem::RegFlags(i,__regHeap)}},
598#define REGDOCFLAGS(i) {"docflags",{TRegItem::RegFlags(i,__regHeap)}},
603#define REGISTRATION_FORMAT_BUFFER(n) \
604 TRegFormatHeap __regHeap;
606#define REGISTRATION_FORMAT_HEAP \
607 TRegFormatHeap __regHeap;
637#define ocrRichText _T("Rich Text Format")
638#define ocrEmbedSource _T("Embed Source")
639#define ocrEmbeddedObject _T("Embedded Object")
640#define ocrLinkSource _T("Link Source")
641#define ocrObjectDescriptor _T("Object Descriptor")
642#define ocrLinkSrcDescriptor _T("Link Source Descriptor")
726#define ocrSingleUse _T("1")
727#define ocrMultipleUse _T("2")
728#define ocrMultipleLocal _T("3")
750 LPCTSTR operator [](
int i);
760 void Activate(
int i);
761 void Activate(LPCTSTR set);
764 bool IsActive(
int i)
const;
793 int Find(LPCTSTR param);
795 int GetCount()
const;
796 const tchar*& Value(
int i);
797 void ResetDefaultValues();
799 const TEntry& operator [](
int i)
const;
804 const tchar** Values;
818 void Init(LPCTSTR filter);
871 return ::RegEnumKey(
Key, index, subKeyName, subKeyNameSize);
880 return ::RegDeleteKey(
Key, subKeyName);
888 return ::RegFlushKey(
Key);
897inline auto TRegKey::GetSecurity(SECURITY_INFORMATION infoRequested, PSECURITY_DESCRIPTOR secDesc, DWORD* secDescSize)
const ->
long
899 return ::RegGetKeySecurity(
Key, infoRequested, secDesc, secDescSize);
924 return ::RegSetKeySecurity(
Key, infoToSet, secDesc);
938 if (r != ERROR_SUCCESS)
throw TXRegistry{
_T(
"TRegKey::SetSecurity failed"), *
this, r};
946 return ::RegSaveKey(
Key, fileName,
nullptr);
958 return ::RegLoadKey(
Key, subKeyName, fileName);
968 return ::RegReplaceKey(
Key, subKeyName, newFileName, oldFileName);
978 return ::RegRestoreKey(
Key, fileName, options);
986 return ::RegUnLoadKey(
Key, subKeyName);
1010 return Name.c_str();
1018 return ::RegSetValueEx(
Key, valName, 0, type, data, dataSize);
1026 return SetValue(valName, REG_DWORD, (
uint8*) &data,
sizeof data);
1034 const auto data =
reinterpret_cast<const uint8*
>(value.data());
1035 const auto dataSize =
static_cast<uint32>((value.size() + 1) *
sizeof(
tchar));
1036 return SetValue(valName, REG_SZ, data, dataSize);
1045 return ::RegQueryValueEx(
Key, valName,
nullptr, (
unsigned int*) type, data, (
unsigned int*) dataSize);
1047 return ::RegQueryValueEx(
Key, valName,
nullptr, type, data, dataSize);
1056 return ::RegDeleteValue(
Key, valName);
1059#if defined(OWL5_COMPAT)
1064inline long TRegKey::SetDefValue(LPCTSTR subkeyName,
uint32 type, LPCTSTR data,
uint32 dataSize)
1066 return ::RegSetValue(
Key, subkeyName, type, data, dataSize);
1072inline long TRegKey::QueryDefValue(LPCTSTR subkeyName, LPTSTR data,
uint32* dataSize)
const
1075 return ::RegQueryValue(
Key, subkeyName, data, (
int*) dataSize);
1077 return ::RegQueryValue(
Key, subkeyName, data, (
long*) dataSize);
1090 return ::RegEnumValue(
Key, index, valueName, (
unsigned int*) &valueNameSize, 0, (
unsigned int*) type, data, (
unsigned int*) dataSize);
1092 return ::RegEnumValue(
Key, index, valueName, &valueNameSize, 0, type, data, dataSize);
1105 return Name.c_str();
1142inline TRegKeyIterator::operator bool()
1144 return Index >= 0 && Index < int(Key.GetSubkeyCount());
1185 PRECONDITION((index >= 0) && (index <
int(Key.GetSubkeyCount())));
1186 return Index = index;
1221 : Key(regKey), Index(0)
1228inline TRegValueIterator::operator bool()
1230 return Index >= 0 && Index < int(Key.GetValueCount());
1271 PRECONDITION((index >= 0) && (index <
int(Key.GetValueCount())));
1272 return Index = index;
1389 if (i <= 0 || i > Count)
1400 memset(EnabledFlags, 0x80, Count);
1408 memset(EnabledFlags, 0x00, Count);
1418 if (i > 0 && i <= Count)
1419 EnabledFlags[i - 1] = 0;
1429 if (i > 0 && i <= Count)
1430 EnabledFlags[i - 1]++;
1440 if (i > 0 && i <= Count)
1441 return EnabledFlags[i - 1] > 0;
Diagnostic macros for assertions and tracing.
#define PRECONDITION(condition)
Encapsulates a SECURITY_DESCRIPTOR.
auto IsDaclPresent() const
Returns the SE_DACL_PRESENT flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsAbsolute() const
Returns the inverse of the SE_SELF_RELATIVE flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto GetLength() const -> DWORD
Returns the length, in bytes, of the security descriptor.
auto IsSaclPresent() const
Returns the SE_SACL_PRESENT flag in the SECURITY_DESCRIPTOR_CONTROL structure.
void RemoveGroup()
Removes the primary group information from the security descriptor.
auto IsSaclProtected() const
Returns the SE_SACL_PROTECTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto GetData() const noexcept -> const SECURITY_DESCRIPTOR *
void SetSacl(PACL sacl, bool saclDefaulted=false)
Sets the system access control list (SACL) of the security descriptor.
auto GetDacl() const -> std::optional< PACL >
Retrieves the discretionary access control list (DACL) from the security descriptor.
auto GetOwner() const -> PSID
Retrieves the owner information from the security descriptor.
auto GetData() noexcept -> SECURITY_DESCRIPTOR *
auto IsDaclDefaulted() const
Returns the SE_DACL_DEFAULTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto GetDataSize() const noexcept -> int
void RemoveOwner()
Removes the owner information from the security descriptor.
auto IsSaclAutoInheritRequired() const
Returns the SE_SACL_AUTO_INHERIT_REQ flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsDaclAutoInheritRequired() const
Returns the SE_DACL_AUTO_INHERIT_REQ flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsValid() const noexcept -> bool
Determines whether the components of the security descriptor are valid.
TSecurityDescriptor(const TRegKey &key, SECURITY_INFORMATION infoRequested)
Retrieves a copy of the security descriptor protecting the specified open registry key.
void SetRmControl(UCHAR rmControl)
Sets the resource manager control bits of the security descriptor.
void Initialize(DWORD revision=SECURITY_DESCRIPTOR_REVISION)
Initializes a new security descriptor.
void SetOwner(PSID owner, bool ownerDefaulted=false)
Sets the owner information of the security descriptor.
auto IsSelfRelative() const
Returns the SE_SELF_RELATIVE flag in the SECURITY_DESCRIPTOR_CONTROL structure.
void SetGroup(PSID group, bool groupDefaulted=false)
Sets the primary group information of the security descriptor.
auto IsSaclAutoInherited() const
Returns the SE_SACL_AUTO_INHERITED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto GetControl() const -> SECURITY_DESCRIPTOR_CONTROL
Retrieves the control information from the security descriptor.
auto IsOwnerDefaulted() const
Returns the SE_OWNER_DEFAULTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto GetRevision() const -> DWORD
Retrieves the revision number of the security descriptor structure.
auto IsSaclDefaulted() const
Returns the SE_SACL_DEFAULTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsDaclAutoInherited() const
Returns the SE_DACL_AUTO_INHERITED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
void RemoveDacl()
Removes the discretionary access control list (DACL) from the security descriptor.
void SetDacl(PACL dacl, bool daclDefaulted=false)
Sets the discretionary access control list (DACL) of the security descriptor.
auto GetRmControl() const -> std::optional< UCHAR >
Retrieves the resource manager control bits from the security descriptor.
auto IsGroupDefaulted() const
Returns the SE_GROUP_DEFAULTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsFlagSet(SECURITY_DESCRIPTOR_CONTROL mask) const
Returns true if all the set bits in the given mask are set in the SECURITY_DESCRIPTOR_CONTROL structu...
auto GetGroup() const -> PSID
Retrieves the primary group information from the security descriptor.
void RemoveSacl()
Removes the system access control list (SACL) from the security descriptor.
auto GetSacl() const -> std::optional< PACL >
Retrieves the system access control list (SACL) from the security descriptor.
auto IsRmControlValid() const
Returns the SE_RM_CONTROL_VALID flag in the SECURITY_DESCRIPTOR_CONTROL structure.
auto IsDaclProtected() const
Returns the SE_DACL_PROTECTED flag in the SECURITY_DESCRIPTOR_CONTROL structure.
void RemoveRmControl()
Removes the resource manager control bits from the security descriptor.
Encapsulates a registration key in the Windows Registry.
long EnumValue(int index, TCHAR *valueName, uint32 &valueNameSize, uint32 *type=nullptr, uint8 *data=nullptr, uint32 *dataSize=nullptr) const
Enumerates the values associated with this key.
long UnLoadKey(LPCTSTR subKeyName)
Unloads this key and its subkeys from the registry.
long Save(const tstring &fileName)
long NukeKey(LPCTSTR subKeyName)
Completely eliminates a child key, including any of its subkeys.
auto SetSecurity(SECURITY_INFORMATION infoToSet, PSECURITY_DESCRIPTOR secDesc) const -> long
Sets the security descriptor of this key.
long ReplaceKey(LPCTSTR subKeyName, LPCTSTR newFileName, LPCTSTR oldFileName)
Replaces the file backing this key and all of its subkeys with another file, so that when the system ...
LPCTSTR GetName() const
Returns a string identifying this key.
long SetValue(const tstring &valName, const tstring &value) const
auto GetHandle() const -> THandle
auto HasSubkey(const tstring &keyName) const -> bool
Returns true if this key has a subkey with the given name.
DWORD SubkeyCount
Number of subkeys.
long DeleteKey(LPCTSTR subKeyName)
Deletes the specified subkey of this registry key.
long Save(LPCTSTR fileName)
Saves this key and all of its subkeys and values to the specified file.
tstring Name
This Key's Name.
long QueryInfo(TCHAR *class_, DWORD *classSize, DWORD *subkeyCount, DWORD *maxSubkeyNameSize, DWORD *maxSubkeyClassSize, DWORD *valueCount, DWORD *maxValueNameSize, DWORD *maxValueDataSize, DWORD *securityDescriptorSize, PFILETIME lastWriteTime) const
Retrieves information about this registry key.
THandle Key
This Key's Handle.
auto GetSubkey(const tstring &keyName, REGSAM samDesired=KEY_READ) const -> std::optional< TRegKey >
Returns the subkey with the given name, if it exists.
long Restore(const tstring &fileName, uint32 options=0)
long Flush() const
Writes the attribute of this key in the registry.
long Restore(LPCTSTR fileName, uint32 options=0)
Reads the registry information in a specified file and copies it over this key.
long SetValue(const tstring &valName, uint32 type, const uint8 *data, uint32 dataSize) const
auto GetValueOrDefault(const tstring &valueName, T defaultValue) const
Returns the value of the given name, if it exists, or the given default value, otherwise.
long DeleteValue(const tstring &valName) const
long SetValue(LPCTSTR valName, uint32 type, const uint8 *data, uint32 dataSize) const
Associates a value with this key.
long LoadKey(LPCTSTR subKeyName, LPCTSTR fileName)
Creates a subkey under HKEY_USER or HKEY_LOCAL_MACHINE and stores registration information from a spe...
long DeleteKey(const tstring &subKeyName)
long DeleteValue(LPCTSTR valName) const
Removes a named value from this registry key.
auto GetSecurity(SECURITY_INFORMATION infoRequested, PSECURITY_DESCRIPTOR secDesc, DWORD *secDescSize) const -> long
Retrieves a copy of the security descriptor protecting this registry key.
long UnLoadKey(const tstring &subKeyName)
long NukeKey(const tstring &subKeyName)
long QueryValue(const tstring &valName, uint32 *type, uint8 *data, uint32 *dataSize) const
long ReplaceKey(const tstring &subKeyName, const tstring &newFileName, const tstring &oldFileName)
auto GetValue(const tstring &valueName) const -> std::optional< TRegValue >
Returns the value with the given name, if it exists within this key.
bool ShouldClose
Should this key be closed on destruction.
long QueryValue(LPCTSTR valName, uint32 *type, uint8 *data, uint32 *dataSize) const
Retrieves the value associated with the unnamed value for this key in the registry.
uint32 GetSubkeyCount() const
Returns the number of subkeys attached to this key.
long EnumKey(int index, TCHAR *subKeyName, int subKeyNameSize) const
Enumerates the subkeys of this registry key.
long LoadKey(const tstring &subKeyName, const tstring &fileName)
uint32 GetValueCount() const
Returns the number of values attached to this key.
long SetValue(const tstring &valName, uint32 data) const
auto HasValue(const tstring &valueName) const -> bool
Return true if this key has a value with the given name.
TRegKey(THandle baseKey, tstring keyName, REGSAM samDesired=KEY_ALL_ACCESS, TCreateOK createOK=CreateOK)
Creates or opens a key given a base key and a subkey name.
DWORD ValueCount
Number of value entries.
TCreateOK
Enumeration used to specify whether a key should be created (or simply opened).
@ NoCreate
Don't create, simply open.
@ CreateOK
Create key if it does not exist.
Iterator for walking thru the subkeys of a key.
uint32 operator[](int index)
Sets the index of the iterator to the passed value.
uint32 operator++()
Preincrements to the next subkey.
uint32 operator--()
Predecrements to the previous subkey.
const TRegKey & BaseKey() const
Returns the registration key this iterator is bound to.
TRegKeyIterator(const TRegKey &key)
Creates a subkey iterator for a registration key.
void Reset()
Resets the subkey index to zero.
int Current() const
Returns the index to the current subkey.
TRegLink * Next
Next RegLink.
virtual ~TRegLink()
Registration link node destructor.
TRegLink * GetNext() const
Returns a pointer to the next link.
void SetNext(TRegLink *link)
static void AddLink(TRegLink **head, TRegLink *newLink)
Adds a new link to the end of the link list.
TRegLink(TRegList ®List, TRegLink *&head)
Constructs a reglink pointing to a reglist, and adds it to the end of the list.
TRegList * RegList
Pointer to registration parameter table.
TRegLink()
Derived class must fill in ptrs.
TRegList & GetRegList() const
Returns a pointer to the registration parameter table (reglist).
static bool RemoveLink(TRegLink **head, TRegLink *remLink)
Removes a link from the link list. Returns true if the link is found and removed.
A registration parameter table, composed of a list of TRegItems.
TLocaleString & LookupRef(LPCSTR key)
Looks up and returns a reference to a local string value associated with a particular item name (key)...
TRegList(TRegItem *_list)
Constructs a TRegList object from an array of TRegItems terminated by a NULL item name.
LPCTSTR Lookup(LPCSTR key, TLangId lang=TLocaleString::UserDefaultLangId)
Performs the lookup of the TRegItems using a key (an item name such as progid) and returns the value ...
TLocaleString & LookupRef(const std::string &key)
LPCTSTR operator[](LPCSTR key)
The array operator uses an item name (key) to locate an item in the array.
LPCTSTR operator[](const std::string &key)
LPCTSTR Lookup(const std::string &key, TLangId lang=TLocaleString::UserDefaultLangId)
A list of param entries for use as an intermediate between a TRegList and the actual template list us...
const tchar *& Value(int i)
Return the value of the param entry at the passed index.
int Find(const tstring ¶m)
TRegParamList(const TEntry *)
int Find(LPCTSTR param)
Looks for a given param in this param list.
const TEntry & operator[](int i) const
Return the template string at the passed index.
int GetCount() const
Return the number of param entries in this list.
void StreamOut(TRegItem *item, tostream &out)
void Init(LPCTSTR filter)
TRegTemplateList Templates
void UpdateParams(TLangId lang, TRegItem *item)
TRegSymbolTable(TRegKey &basekey, LPCTSTR tplList[], const TRegParamList::TEntry *paramList)
List of parameterized template strings that represent the actual entries to be registered.
LPCTSTR operator[](int i)
Returns the template string at the passed index.
void DisableAll()
Disables all templates in this list.
bool IsActive(int i) const
Returns true if the template at the passed index is active, false otherwise.
void Activate(int i)
Activates the template at the passed index.
TRegTemplateList(TRegKey &basekey, LPCTSTR _list[])
void Activate(const tstring &set)
void Enable(const tstring &set)
int GetCount() const
Returns the number of templates in this list.
TRegKey & GetBaseKey()
Returns the registry key upon which these templates are based.
void Enable(int i)
Enables the template at the passed index.
void EnableAll()
Enables all templates in this list.
Encapsulates a value-data entry within one registration key.
uint32 GetDataSize() const
Returns the size in bytes of the data associated with this value.
const uint8 * GetData() const
Returns the data associated with this value.
uint32 GetDataType() const
Returns the type code for the data associated with this value.
TRegValue(const TRegKey &key, LPCTSTR name)
Creates a registry value object from the specified registry key and name.
long Delete()
Removes the value from its associated key, and clears the state of this object.
long Set(uint32 type, const uint8 *data, uint32 dataSize)
Sets the data associated with this value.
LPCTSTR GetName() const
Returns a string identifying this value.
Iterator for walking through the values of a key.
void Reset()
Resets the value index to zero.
int Current() const
Returns the index to the current value.
uint32 operator--()
Predecrements to the previous value.
const TRegKey & BaseKey() const
Returns the registration key that this iterator is bound to.
uint32 operator[](int index)
Sets the index of the iterator to the passed value.
uint32 operator++()
Preincrements to the next value.
TRegValueIterator(const TRegKey ®Key)
Creates a value iterator for a registration key.
TRegistry provides high level stream and list access to the registry.
static void Update(TRegKey &baseKey, tistream &in)
Writes lines to registry.
static int Unregister(TRegList ®Info, const TUnregParams *params, const TRegItem *overrides=nullptr)
Unregisters entries given a reglist.
static int Validate(TRegKey &baseKey, tistream &in)
Returns number of mismatched entries.
Thrown for errors within the Registry classes.
TXRegistry(const tstring &context, const TRegKey &key, long errorCode=0)
TXRegistry(const tstring &context, tstring keyName, long errorCode=0)
auto GetKeyName() const -> const tstring &
auto GetErrorCode() const -> long
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
ocrObjectStatus
IOleObject miscellaneous status flags, defined for each or all aspects.
ocrMedium
Medium: means of data transfer.
ocrVerbAttributes
IOleObject verb attribute flags.
ocrAspect
Aspect: view types supported by transfer.
ocrDirection
Direction: transfer directions supported.
const int ocrFormatLimit
Maximum number of data formats per class.
ocrClipFormat
Format: standard clipboard numeric format, or name of custom format.
ocrVerbMenuFlags
IOleObject verb menu flags.
const int ocrVerbLimit
Maximum number of verbs registered per class.
@ ocrCantLinkInside
Should not be the link source.
@ ocrNoSpecialRendering
Older enum for previous entry.
@ ocrStatic
Object is an OLE static object.
@ ocrInsertNotReplace
Should not replace current select.
@ ocrRecomposeOnResize
Request redraw on container resize.
@ ocrRenderingIsDeviceIndependent
No decisions made based on target.
@ ocrOnlyIconic
Only useful context view is Icon.
@ ocrCanLinkByOle1
Only used in OBJECTDESCRIPTOR.
@ ocrActivateWhenVisible
Hint to cntnr when ocrInsideOut set.
@ ocrInsideOut
Can be activated concurrently.
@ ocrIsLinkObject
Set by OLE2 link for OLE1 compat.
@ ocrFile
TYMED_FILE - data as contents of file.
@ ocrStaticMed
OLE 2 static object.
@ ocrIStream
TYMED_ISTREAM - instance of an IStream object.
@ ocrMfPict
TYMED_MFPICT - CF_METAFILEPICT containing global handle.
@ ocrGDI
TYMED_GDI - GDI object in global handle.
@ ocrHGlobal
TYMED_HGLOBAL - global memory handle.
@ ocrIStorage
TYMED_ISTORAGE - streams within an instance of IStorage.
@ ocrNeverDirties
Verb can never cause object to become dirty.
@ ocrOnContainerMenu
Only useful context view is Icon.
@ ocrDocPrint
DVASPECT_DOCPRINT - print preview representation.
@ ocrThumbnail
DVASPECT_THUMBNAIL - picture appropriate for browser.
@ ocrContent
DVASPECT_CONTENT - normal display representation.
@ ocrIcon
DVASPECT_ICON - iconized representation of object.
@ ocrUnicodeText
CF_UNICODETEXT Win32 only.
@ ocrMetafilePict
CF_METAFILEPICT.
@ ocrEnhMetafile
CF_ENHMETAFILE Win32 only.
@ ocrMenuBreak
MF_MENUBAR.
@ ocrMenuBarBreak
MF_MENUBARBREAK.
@ ocrDisabled
MF_DISABLED.
TLocaleString - localized name support.
Reliable platform independent header for common memory and string functions.
Object Windows Library (OWLNext Core).
owl::uint16 TLangId
Holds a language ID, a predefined number that represents a base language and dialect.
ulong TStaticSync< T >::Count
ObjectWindows exception class & function definitions.
Designed to provide support for localized registration parameters, the TLocaleString Struct defines a...
static TLangId UserDefaultLangId
The user-defined default language identifier.
A single registration list entry.
TLocaleString Value
Localizable value for parameter or subkey.
const char * Key
Non-localized parameter or registry subkey.
static tchar * RegFormat(int f, int a, int t, int d, TRegFormatHeap &heap)
Registers data formats for the object.
static tchar * RegFormat(const tstring &f, int a, int t, int d, TRegFormatHeap &heap)
static void OverflowCheck()
Data structure returned by QueryInfo.
DWORD SecurityDescriptorSize
DWORD MaxValueDataSize
In bytes.
LPCTSTR Default
Default value, 0 if no default & param is required.
LPCTSTR TemplatesNeeded
Octal string list of template indices to activate.
LPCTSTR Param
Substituted parameter name.
tchar Prepend
Optional tchar to prepend to key before removing.
LPCTSTR Name
Name of param.
TRegKey * BaseKey
Key that that the param is based upon.
Includes windowing system headers, with necessary macros defined.