Update ooo320-m1
[ooovba.git] / autodoc / inc / ary / cpp / c_vfflag.hxx
blobf2256619a42235bc917a091d65f5cfeb74905d03
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: c_vfflag.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef ARY_CPP_C_VFFLAG_HXX
32 #define ARY_CPP_C_VFFLAG_HXX
34 // USED SERVICES
37 namespace ary
39 namespace cpp
43 /** Properties of C++ variables.
45 struct VariableFlags
47 public:
48 enum E_Flags
50 f_static_local = 0x0001,
51 f_static_member = 0x0002,
52 f_extern = 0x0004,
53 f_mutable = 0x0008
56 VariableFlags(
57 UINT16 i_nFlags = 0 )
58 : nFlags(i_nFlags) {}
60 void Reset() { nFlags = 0; }
62 void SetStaticLocal() { nFlags |= f_static_local; }
63 void SetStaticMember() { nFlags |= f_static_member; }
64 void SetExtern() { nFlags |= f_extern; }
65 void SetMutable() { nFlags |= f_mutable; }
67 bool IsStaticLocal() const { return (nFlags & f_static_local) != 0; }
68 bool IsStaticMember() const { return (nFlags & f_static_member) != 0; }
69 bool IsExtern() const { return (nFlags & f_extern) != 0; }
70 bool IsMutable() const { return (nFlags & f_mutable) != 0; }
72 private:
73 UINT16 nFlags;
77 /** Properties of C++ functions.
79 struct FunctionFlags
81 public:
82 enum E_Flags
84 f_static_local = 0x0001,
85 f_static_member = 0x0002,
86 f_extern = 0x0004,
87 f_externC = 0x0008,
88 f_mutable = 0x0010,
89 f_inline = 0x0100,
90 f_register = 0x0200,
91 f_explicit = 0x0400
94 FunctionFlags(
95 UINT16 i_nFlags = 0 )
96 : nFlags(i_nFlags) {}
98 bool operator==(
99 const FunctionFlags &
100 i_ff ) const
101 { return nFlags == i_ff.nFlags; }
102 bool operator!=(
103 const FunctionFlags &
104 i_ff ) const
105 { return NOT operator==(i_ff); }
107 void Reset() { nFlags = 0; }
109 void SetStaticLocal() { nFlags |= f_static_local; }
110 void SetStaticMember() { nFlags |= f_static_member; }
111 void SetExtern() { nFlags |= f_extern; }
112 void SetExternC() { nFlags |= f_externC; }
113 void SetMutable() { nFlags |= f_mutable; }
114 void SetInline() { nFlags |= f_inline; }
115 void SetRegister() { nFlags |= f_register; }
116 void SetExplicit() { nFlags |= f_explicit; }
118 bool IsStaticLocal() const { return (nFlags & f_static_local) != 0; }
119 bool IsStaticMember() const { return (nFlags & f_static_member) != 0; }
120 bool IsExtern() const { return (nFlags & f_extern) != 0; }
121 bool IsExternC() const { return (nFlags & f_externC) != 0; }
122 bool IsMutable() const { return (nFlags & f_mutable) != 0; }
123 bool IsInline() const { return (nFlags & f_inline) != 0; }
124 bool IsRegister() const { return (nFlags & f_register) != 0; }
125 bool IsExplicit() const { return (nFlags & f_explicit) != 0; }
127 private:
128 UINT16 nFlags;
132 /** A C++ function parameter.
134 struct S_Parameter
136 String sName;
137 String sSizeExpression;
138 String sInitExpression;
139 Type_id nType;
141 S_Parameter() : nType(0) {}
142 ~S_Parameter() {}
143 void Empty() { nType = Type_id(0);
144 sName.clear();
145 sSizeExpression.clear();
146 sInitExpression.clear(); }
152 } // namespace cpp
153 } // namespace ary
154 #endif