1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_RSC_INC_RSCTREE_HXX
20 #define INCLUDED_RSC_INC_RSCTREE_HXX
22 #include <tools/link.hxx>
23 #include <rsctools.hxx>
28 BiNode
* pLeft
; // left subtree
29 BiNode
* pRight
; // right subtree
33 // Wandelt eine doppelt verkettete Liste in
34 // einen binaeren Baum um
35 BiNode
* ChangeDLListBTree( BiNode
* pList
);
41 // Wandelt einen binaeren Baum in eine doppelt
42 // verkettete Liste um
43 BiNode
* ChangeBTreeDLList();
45 BiNode
* Left() const { return pLeft
; }
46 BiNode
* Right() const{ return pRight
; }
47 void EnumNodes( Link
<> aLink
) const;
50 class NameNode
: public BiNode
52 void SubOrderTree( NameNode
* pOrderNode
);
55 // pCmp ist Zeiger auf Namen
56 NameNode
* Search( const void * pCmp
) const;
59 NameNode
* Left() const { return static_cast<NameNode
*>(pLeft
); }
60 NameNode
* Right() const{ return static_cast<NameNode
*>(pRight
); }
61 NameNode
* Search( const NameNode
* pName
) const;
62 // insert a new node in the b-tree
63 bool Insert( NameNode
* pTN
, sal_uInt32
* nDepth
);
64 bool Insert( NameNode
* pTN
);
65 virtual COMPARE
Compare( const NameNode
* ) const;
66 virtual COMPARE
Compare( const void * ) const;
67 NameNode
* SearchParent( const NameNode
* ) const;
68 // return ist neue Root
69 NameNode
* Remove( NameNode
* );
73 class IdNode
: public NameNode
75 virtual COMPARE
Compare( const NameNode
* ) const SAL_OVERRIDE
;
76 virtual COMPARE
Compare( const void * ) const SAL_OVERRIDE
;
78 using NameNode::Search
;
82 IdNode
* Search( sal_uInt32 nTypName
) const;
83 virtual sal_uInt32
GetId() const;
86 class StringNode
: public NameNode
88 virtual COMPARE
Compare( const NameNode
* ) const SAL_OVERRIDE
;
89 virtual COMPARE
Compare( const void * ) const SAL_OVERRIDE
;
92 using NameNode::Search
;
98 StringNode(const OString
& rStr
) { m_aName
= rStr
; }
100 StringNode
* Search( const char * ) const;
101 OString
GetName() const { return m_aName
; }
104 #endif // INCLUDED_RSC_INC_RSCTREE_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */