1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: wtranode.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef TX3_WTRANODE_HXX
33 #define TX3_WTRANODE_HXX
39 #include <tools/string.hxx>
42 typedef UINT8 BRANCH_T
;
46 const BRANCH_T C_BR_ALPHABASE
= 4;
47 const BRANCH_T C_NR_OF_BRANCHES
= 34;
53 This is a node of the parsing-tree which implements the fuctionality of
55 WordTransTree is dependant of this class, but NOT the other way!
57 class WTT_Node
// WordTransTree-Node
69 UINT8 i_nValue
, // Own branch-value.
70 WTT_Node
* i_pDefaultBranch
,
71 WTT_Node
* i_pDefaultBranchForAlphas
);
75 void SetAsTokenToReplace(
76 const ByteString
& i_sReplaceString
);
80 WTT_Node
* GetNextNode(
81 UINT8 i_cBranch
); /// [0 .. C_NR_OF_BRANCHES-1], sonst GPF !!!
84 E_TokenType
TokenType() const;
86 BOOL
IsOnDeleting() const;
87 const ByteString
& ReplaceString() const;
93 ByteString sReplaceString
;
94 WTT_Node
* aBranches
[C_NR_OF_BRANCHES
]; // Mostly DYN pointers.
100 WTT_Node::GetNextNode(UINT8 i_cBranch
)
101 { return aBranches
[i_cBranch
]; }
102 inline WTT_Node::E_TokenType
103 WTT_Node::TokenType() const
106 WTT_Node::Value() const
109 WTT_Node::IsOnDeleting() const
110 { return bIsOnDeleting
; }
111 inline const ByteString
&
112 WTT_Node::ReplaceString() const
113 { return sReplaceString
; }