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: defdescr.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 ************************************************************************/
31 #ifndef ADC_CPP_DEFDESCR_HXX
32 #define ADC_CPP_DEFDESCR_HXX
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
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
);
64 /// Only vaild if (eDefineType == type_define) else returns "".
66 csv::StreamStr
& o_rText
) const;
68 /// Only vaild if (eDefineType == type_macro) else returns "".
70 csv::StreamStr
& o_rText
,
72 i_rGivenArguments
) const;
74 uintt
ParamCount() const;
75 E_DefineType
DefineType() const;
81 str_vector aDefinition
;
82 E_DefineType eDefineType
;
90 DefineDescription::ParamCount() const
91 { return aParams
.size(); }
92 inline DefineDescription::E_DefineType
93 DefineDescription::DefineType() const
94 { return eDefineType
; }
99 } // end namespace cpp