merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / parser / cpp / defdescr.hxx
blob463db9df089791b00fa5c8036615fdb05b12def8
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: defdescr.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 ADC_CPP_DEFDESCR_HXX
32 #define ADC_CPP_DEFDESCR_HXX
37 namespace cpp
40 /** Describes a C/C++ #define statement. May be a define or a macro, for which
41 two cases the two different constructors are to be used.
43 This class is used by cpp::PreProcessor.
45 class DefineDescription
47 public:
48 enum E_DefineType
50 type_define,
51 type_macro
53 typedef StringVector str_vector;
55 DefineDescription( /// Used for: #define DEFINE xyz
56 const String & i_sName,
57 const str_vector & i_rDefinition );
58 DefineDescription( /// Used for: #define MACRO(...) abc
59 const String & i_sName,
60 const str_vector & i_rParams,
61 const str_vector & i_rDefinition );
62 ~DefineDescription();
64 /// Only vaild if (eDefineType == type_define) else returns "".
65 void GetDefineText(
66 csv::StreamStr & o_rText ) const;
68 /// Only vaild if (eDefineType == type_macro) else returns "".
69 void GetMacroText(
70 csv::StreamStr & o_rText,
71 const StringVector &
72 i_rGivenArguments ) const;
74 uintt ParamCount() const;
75 E_DefineType DefineType() const;
77 private:
78 // DATA
79 String sName;
80 str_vector aParams;
81 str_vector aDefinition;
82 E_DefineType eDefineType;
88 // IMPLEMENTATION
89 inline uintt
90 DefineDescription::ParamCount() const
91 { return aParams.size(); }
92 inline DefineDescription::E_DefineType
93 DefineDescription::DefineType() const
94 { return eDefineType; }
99 } // end namespace cpp
100 #endif