bump product version to 4.2.0.1
[LibreOffice.git] / rsc / inc / rsctree.hxx
blobee674d4b947b8fbe14249613db8c7e452b0f581c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _RSCTREE_HXX
20 #define _RSCTREE_HXX
22 #include <tools/link.hxx>
23 #include <rsctools.hxx>
25 class BiNode
27 protected:
28 BiNode* pLeft; // left subtree
29 BiNode* pRight; // right subtree
31 public:
33 // Wandelt eine doppelt verkettete Liste in
34 // einen binaeren Baum um
35 BiNode * ChangeDLListBTree( BiNode * pList );
37 BiNode();
38 virtual ~BiNode();
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 );
54 protected:
55 // pCmp ist Zeiger auf Namen
56 NameNode* Search( const void * pCmp ) const;
58 public:
59 NameNode* Left() const { return (NameNode *)pLeft ; };
60 NameNode* Right() const{ return (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 * );
70 void OrderTree();
73 class IdNode : public NameNode
75 virtual COMPARE Compare( const NameNode * ) const;
76 virtual COMPARE Compare( const void * ) const;
77 protected:
78 using NameNode::Search;
80 public:
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;
89 virtual COMPARE Compare( const void * ) const;
91 protected:
92 using NameNode::Search;
94 OString m_aName;
96 public:
97 StringNode() {}
98 StringNode(const OString& rStr) { m_aName = rStr; }
100 StringNode* Search( const char * ) const;
101 OString GetName() const { return m_aName; }
104 #endif // _RSCTREE_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */