Update ooo320-m1
[ooovba.git] / autodoc / source / inc / adc_cl.hxx
blobfb891e63dc29fc661b354bed8f128168fb93e22f
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: adc_cl.hxx,v $
10 * $Revision: 1.9 $
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_ADC_CL_HXX
32 #define ADC_ADC_CL_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <cosv/comdline.hxx>
39 // COMPONENTS
40 // PARAMETERS
42 namespace ary
44 class Repository;
47 namespace autodoc
49 namespace command
51 class Command;
52 class CreateHtml;
53 class SinceTagTransformationData;
57 /** Reads and runs an Autodoc command line.
59 class CommandLine : public csv::CommandLine_Ifc
61 public:
62 // LIFECYCLE
63 CommandLine();
64 ~CommandLine();
65 // OPERATIONS
66 int Run() const;
68 // INQUIRY
69 // debugging
70 bool DebugStyle_ShowText() const;
71 bool DebugStyle_ShowStoredObjects() const;
72 bool DebugStyle_ShowTokens() const;
74 // @since tags
75 bool DoesTransform_SinceTag() const;
77 // /// @see command::SinceTagTransformationData::StripSinceTagValue()
78 // bool Strip_SinceTagText(
79 // String & io_sSinceTagValue ) const;
81 /// @see command::SinceTagTransformationData::DisplayOf()
82 const String & DisplayOf_SinceTagValue(
83 const String & i_sVersionNumber ) const;
85 // extern IDL links
86 const String & ExternRoot() const { return sExternRoot; }
87 const String & ExternNamespace() const { return sExternNamespace; }
89 bool CppUsed() const { return bCpp; }
90 bool IdlUsed() const { return bIdl; }
92 // ACCESS
93 static CommandLine &
94 Get_();
95 void Set_ExternRoot(
96 const String & i_s )
97 { sExternRoot = i_s; }
98 void Set_ExternNamespace(
99 const String & i_s )
100 { sExternNamespace = i_s; }
101 ary::Repository & TheRepository() const { csv_assert(pReposy != 0);
102 return *pReposy; }
103 void Set_CppUsed() { bCpp = true; }
104 void Set_IdlUsed() { bIdl = true; }
106 private:
107 // Interface cosv::CommandLine_Ifc:
108 virtual void do_Init(
109 int argc,
110 char * argv[] );
111 virtual void do_PrintUse() const;
112 virtual bool inq_CheckParameters() const;
114 // Locals
115 typedef StringVector::const_iterator opt_iter;
116 typedef std::vector< DYN command::Command* > CommandList;
118 void load_IncludedCommands(
119 StringVector & out,
120 const char * i_filePath );
122 void do_clVerbose(
123 opt_iter & it,
124 opt_iter itEnd );
125 void do_clParse(
126 opt_iter & it,
127 opt_iter itEnd );
128 void do_clCreateHtml(
129 opt_iter & it,
130 opt_iter itEnd );
131 void do_clSinceFile(
132 opt_iter & it,
133 opt_iter itEnd );
135 // void do_clCreateXml(
136 // opt_iter & it,
137 // opt_iter itEnd );
138 // void do_clLoad(
139 // opt_iter & it,
140 // opt_iter itEnd );
141 // void do_clSave(
142 // opt_iter & it,
143 // opt_iter itEnd );
145 void sort_Commands();
147 // DATA
148 uintt nDebugStyle;
149 Dyn<command::SinceTagTransformationData>
150 pSinceTransformator;
152 CommandList aCommands;
153 bool bInitOk;
154 command::CreateHtml *
155 pCommand_CreateHtml;
157 String sExternRoot;
158 String sExternNamespace;
160 mutable Dyn<ary::Repository>
161 pReposy;
162 bool bCpp;
163 bool bIdl;
165 static CommandLine *
166 pTheInstance_;
171 // IMPLEMENTATION
172 inline bool
173 CommandLine::DebugStyle_ShowText() const
174 { return (nDebugStyle & 2) != 0; }
175 inline bool
176 CommandLine::DebugStyle_ShowStoredObjects() const
177 { return (nDebugStyle & 4) != 0; }
178 inline bool
179 CommandLine::DebugStyle_ShowTokens() const
180 { return (nDebugStyle & 1) != 0; }
182 } // namespace autodoc
185 inline bool
186 DEBUG_ShowText()
187 { return autodoc::CommandLine::Get_().DebugStyle_ShowText(); }
188 inline bool
189 DEBUG_ShowStoring()
190 { return autodoc::CommandLine::Get_().DebugStyle_ShowStoredObjects(); }
191 inline bool
192 DEBUG_ShowTokens()
193 { return autodoc::CommandLine::Get_().DebugStyle_ShowTokens(); }
195 #endif