Bump for 3.6-28
[LibreOffice.git] / autodoc / source / inc / adc_cl.hxx
blob6e5e740a44bc5af05e7a1c0a4286abcf7a93061b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef ADC_ADC_CL_HXX
30 #define ADC_ADC_CL_HXX
34 // USED SERVICES
35 // BASE CLASSES
36 #include <cosv/comdline.hxx>
37 // COMPONENTS
38 // PARAMETERS
40 namespace ary
42 class Repository;
45 namespace autodoc
47 namespace command
49 class Command;
50 class CreateHtml;
51 class SinceTagTransformationData;
55 /** Reads and runs an Autodoc command line.
57 class CommandLine : public csv::CommandLine_Ifc
59 public:
60 // LIFECYCLE
61 CommandLine();
62 ~CommandLine();
63 // OPERATIONS
64 int Run() const;
66 // INQUIRY
67 // debugging
68 bool DebugStyle_ShowText() const;
69 bool DebugStyle_ShowStoredObjects() const;
70 bool DebugStyle_ShowTokens() const;
72 // @since tags
73 bool DoesTransform_SinceTag() const;
75 // /// @see command::SinceTagTransformationData::StripSinceTagValue()
76 // bool Strip_SinceTagText(
77 // String & io_sSinceTagValue ) const;
79 /// @see command::SinceTagTransformationData::DisplayOf()
80 const String & DisplayOf_SinceTagValue(
81 const String & i_sVersionNumber ) const;
83 // extern IDL links
84 const String & ExternRoot() const { return sExternRoot; }
85 const String & ExternNamespace() const { return sExternNamespace; }
87 bool IdlUsed() const { return bIdl; }
89 // ACCESS
90 static CommandLine &
91 Get_();
92 void Set_ExternRoot(
93 const String & i_s )
94 { sExternRoot = i_s; }
95 void Set_ExternNamespace(
96 const String & i_s )
97 { sExternNamespace = i_s; }
98 ary::Repository & TheRepository() const { csv_assert(pReposy != 0);
99 return *pReposy; }
100 void Set_IdlUsed() { bIdl = true; }
102 private:
103 // Interface cosv::CommandLine_Ifc:
104 virtual void do_Init(
105 int argc,
106 char * argv[] );
107 virtual void do_PrintUse() const;
108 virtual bool inq_CheckParameters() const;
110 // Locals
111 typedef StringVector::const_iterator opt_iter;
112 typedef std::vector< DYN command::Command* > CommandList;
114 void load_IncludedCommands(
115 StringVector & out,
116 const char * i_filePath );
118 void do_clVerbose(
119 opt_iter & it,
120 opt_iter itEnd );
121 void do_clParse(
122 opt_iter & it,
123 opt_iter itEnd );
124 void do_clCreateHtml(
125 opt_iter & it,
126 opt_iter itEnd );
127 void do_clSinceFile(
128 opt_iter & it,
129 opt_iter itEnd );
131 // void do_clCreateXml(
132 // opt_iter & it,
133 // opt_iter itEnd );
134 // void do_clLoad(
135 // opt_iter & it,
136 // opt_iter itEnd );
137 // void do_clSave(
138 // opt_iter & it,
139 // opt_iter itEnd );
141 void sort_Commands();
143 // DATA
144 uintt nDebugStyle;
145 Dyn<command::SinceTagTransformationData>
146 pSinceTransformator;
148 CommandList aCommands;
149 bool bInitOk;
150 command::CreateHtml *
151 pCommand_CreateHtml;
153 String sExternRoot;
154 String sExternNamespace;
156 mutable Dyn<ary::Repository>
157 pReposy;
158 bool bIdl;
160 static CommandLine *
161 pTheInstance_;
166 // IMPLEMENTATION
167 inline bool
168 CommandLine::DebugStyle_ShowText() const
169 { return (nDebugStyle & 2) != 0; }
170 inline bool
171 CommandLine::DebugStyle_ShowStoredObjects() const
172 { return (nDebugStyle & 4) != 0; }
173 inline bool
174 CommandLine::DebugStyle_ShowTokens() const
175 { return (nDebugStyle & 1) != 0; }
177 } // namespace autodoc
180 inline bool
181 DEBUG_ShowText()
182 { return autodoc::CommandLine::Get_().DebugStyle_ShowText(); }
183 inline bool
184 DEBUG_ShowStoring()
185 { return autodoc::CommandLine::Get_().DebugStyle_ShowStoredObjects(); }
186 inline bool
187 DEBUG_ShowTokens()
188 { return autodoc::CommandLine::Get_().DebugStyle_ShowTokens(); }
190 #endif
192 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */