OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
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
11
namespace
owl
{
12
13
//
14
/// Constructs a reglink pointing to a reglist, and adds it to the end of the list.
15
//
16
TRegLink::TRegLink
(
TRegList
& regList,
TRegLink
*& head)
17
:
18
Next
(nullptr),
19
RegList
(®List)
20
{
21
AddLink
(&head,
this
);
22
}
23
24
//
25
/// Adds a new link to the end of the link list.
26
//
27
void
TRegLink::AddLink
(
TRegLink
** head,
TRegLink
* newLink)
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
//
50
bool
TRegLink::RemoveLink
(
TRegLink
** head,
TRegLink
* remLink)
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
/* ========================================================================== */
owl::TRegLink::Next
TRegLink * Next
Next RegLink.
Definition
registry.h:576
owl::TRegLink::GetNext
TRegLink * GetNext() const
Returns a pointer to the next link.
Definition
registry.h:1337
owl::TRegLink::SetNext
void SetNext(TRegLink *link)
Definition
registry.h:1342
owl::TRegLink::AddLink
static void AddLink(TRegLink **head, TRegLink *newLink)
Adds a new link to the end of the link list.
Definition
reglink.cpp:27
owl::TRegLink::TRegLink
TRegLink(TRegList ®List, TRegLink *&head)
Constructs a reglink pointing to a reglist, and adds it to the end of the list.
Definition
reglink.cpp:16
owl::TRegLink::RegList
TRegList * RegList
Pointer to registration parameter table.
Definition
registry.h:577
owl::TRegLink::TRegLink
TRegLink()
Derived class must fill in ptrs.
Definition
registry.h:1358
owl::TRegLink::RemoveLink
static bool RemoveLink(TRegLink **head, TRegLink *remLink)
Removes a link from the link list. Returns true if the link is found and removed.
Definition
reglink.cpp:50
owl::TRegList
A registration parameter table, composed of a list of TRegItems.
Definition
registry.h:531
pch.h
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
registry.h
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...
string.h
Definition of class TString, a flexible universal string envelope class.
source
owlcore
reglink.cpp
Generated by
1.18.0