OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
reglink.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4//
5//----------------------------------------------------------------------------
6#include <owl/pch.h>
7
8#include <owl/registry.h>
9#include <string.h>
10
11namespace owl {
12
13//
14/// Constructs a reglink pointing to a reglist, and adds it to the end of the list.
15//
17:
18 Next(nullptr),
19 RegList(&regList)
20{
21 AddLink(&head, this);
22}
23
24//
25/// Adds a new link to the end of the link list.
26//
28{
29#if !defined(BI_VIRTUAL_BUG)
30 TRegLink** link = head;
31 while (*link) // put new link at end of list
32 link = &(*link)->Next;
33 *link = newLink;
34#else
35 if(*head == 0)
36 *head = newLink;
37 else{
38 TRegLink* link = *head;
39 while (link->GetNext() != 0) // put new link at end of list
40 link = link->GetNext();// = &(*link)->Next;
41 link->SetNext(newLink);
42 }
43#endif
44
45}
46
47//
48/// Removes a link from the link list. Returns true if the link is found and removed.
49//
51{
52#if !defined(BI_VIRTUAL_BUG)
53 for (TRegLink** link = head; *link; link = &(*link)->Next){
54 if (*link == remLink) {
55 *link = (*link)->Next; // remove from list
56 return true;
57 }
58 }
59#else
60 if(*head == remLink){
61 (*head) = (*head)->GetNext();
62 return true;
63 }
64
65 for( TRegLink* link = *head; link->GetNext(); link = link->GetNext()){
66 if(link->GetNext() == remLink){
67 link->SetNext(link->GetNext());// remove from list
68 return true;
69 }
70 }
71
72#endif
73 return false;
74}
75
76} // OWL namespace
77/* ========================================================================== */
A registration parameter table, composed of a list of TRegItems.
Definition registry.h:531
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...
Definition of class TString, a flexible universal string envelope class.