xref: /aoo42x/main/autodoc/source/inc/adc_cl.hxx (revision b32aa359)
11c78a5d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31c78a5d6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41c78a5d6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51c78a5d6SAndrew Rist  * distributed with this work for additional information
61c78a5d6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71c78a5d6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81c78a5d6SAndrew Rist  * "License"); you may not use this file except in compliance
91c78a5d6SAndrew Rist  * with the License.  You may obtain a copy of the License at
101c78a5d6SAndrew Rist  *
111c78a5d6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
121c78a5d6SAndrew Rist  *
131c78a5d6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141c78a5d6SAndrew Rist  * software distributed under the License is distributed on an
151c78a5d6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161c78a5d6SAndrew Rist  * KIND, either express or implied.  See the License for the
171c78a5d6SAndrew Rist  * specific language governing permissions and limitations
181c78a5d6SAndrew Rist  * under the License.
191c78a5d6SAndrew Rist  *
201c78a5d6SAndrew Rist  *************************************************************/
211c78a5d6SAndrew Rist 
221c78a5d6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef ADC_ADC_CL_HXX
25cdf0e10cSrcweir #define ADC_ADC_CL_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir 
29cdf0e10cSrcweir // USED SERVICES
30cdf0e10cSrcweir 	// BASE CLASSES
31cdf0e10cSrcweir #include <cosv/comdline.hxx>
32cdf0e10cSrcweir 	// COMPONENTS
33cdf0e10cSrcweir 	// PARAMETERS
34cdf0e10cSrcweir 
35*b32aa359SDamjan Jovanovic #include <vector>
36*b32aa359SDamjan Jovanovic 
37cdf0e10cSrcweir namespace ary
38cdf0e10cSrcweir {
39cdf0e10cSrcweir     class Repository;
40cdf0e10cSrcweir }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir namespace autodoc
43cdf0e10cSrcweir {
44cdf0e10cSrcweir namespace command
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     class Command;
47cdf0e10cSrcweir     class CreateHtml;
48cdf0e10cSrcweir     class SinceTagTransformationData;
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir 
52cdf0e10cSrcweir /** Reads and runs an Autodoc command line.
53cdf0e10cSrcweir */
54cdf0e10cSrcweir class CommandLine : public csv::CommandLine_Ifc
55cdf0e10cSrcweir {
56cdf0e10cSrcweir   public:
57cdf0e10cSrcweir     // LIFECYCLE
58cdf0e10cSrcweir 						CommandLine();
59cdf0e10cSrcweir 						~CommandLine();
60cdf0e10cSrcweir     // OPERATIONS
61cdf0e10cSrcweir     int                 Run() const;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // INQUIRY
64cdf0e10cSrcweir         // debugging
65cdf0e10cSrcweir     bool                DebugStyle_ShowText() const;
66cdf0e10cSrcweir     bool                DebugStyle_ShowStoredObjects() const;
67cdf0e10cSrcweir     bool                DebugStyle_ShowTokens() const;
68cdf0e10cSrcweir 
69cdf0e10cSrcweir         // @since tags
70cdf0e10cSrcweir     bool                DoesTransform_SinceTag() const;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir //    /// @see command::SinceTagTransformationData::StripSinceTagValue()
73cdf0e10cSrcweir //    bool                Strip_SinceTagText(
74cdf0e10cSrcweir //                            String &            io_sSinceTagValue ) const;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     /// @see command::SinceTagTransformationData::DisplayOf()
77cdf0e10cSrcweir     const String &      DisplayOf_SinceTagValue(
78cdf0e10cSrcweir                             const String &      i_sVersionNumber ) const;
79cdf0e10cSrcweir 
IgnoreDefines() const80*b32aa359SDamjan Jovanovic     const ::std::vector<String> & IgnoreDefines() const
81*b32aa359SDamjan Jovanovic                                                 { return ignoreDefines; }
82*b32aa359SDamjan Jovanovic 
83cdf0e10cSrcweir         // extern IDL links
ExternRoot() const84cdf0e10cSrcweir     const String &      ExternRoot() const      { return sExternRoot; }
ExternNamespace() const85cdf0e10cSrcweir     const String &      ExternNamespace() const { return sExternNamespace; }
86cdf0e10cSrcweir 
CppUsed() const87cdf0e10cSrcweir     bool                CppUsed() const         { return bCpp; }
IdlUsed() const88cdf0e10cSrcweir     bool                IdlUsed() const         { return bIdl; }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     // ACCESS
AddIgnoreDefine(const String & define)91*b32aa359SDamjan Jovanovic     void                AddIgnoreDefine(
92*b32aa359SDamjan Jovanovic                             const String& define)
93*b32aa359SDamjan Jovanovic                                                 { ignoreDefines.push_back(define); }
94cdf0e10cSrcweir     static CommandLine &
95cdf0e10cSrcweir                         Get_();
Set_ExternRoot(const String & i_s)96cdf0e10cSrcweir     void                Set_ExternRoot(
97cdf0e10cSrcweir                             const String &      i_s )
98cdf0e10cSrcweir                                                 { sExternRoot = i_s; }
Set_ExternNamespace(const String & i_s)99cdf0e10cSrcweir     void                Set_ExternNamespace(
100cdf0e10cSrcweir                             const String &      i_s )
101cdf0e10cSrcweir                                                 { sExternNamespace = i_s; }
TheRepository() const102cdf0e10cSrcweir     ary::Repository &   TheRepository() const   { csv_assert(pReposy != 0);
103cdf0e10cSrcweir                                                   return *pReposy; }
Set_CppUsed()104cdf0e10cSrcweir     void                Set_CppUsed()           { bCpp = true; }
Set_IdlUsed()105cdf0e10cSrcweir     void                Set_IdlUsed()           { bIdl = true; }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir   private:
108cdf0e10cSrcweir     // Interface cosv::CommandLine_Ifc:
109cdf0e10cSrcweir     virtual void        do_Init(
110cdf0e10cSrcweir                             int                 argc,
111cdf0e10cSrcweir                             char *              argv[] );
112cdf0e10cSrcweir     virtual void        do_PrintUse() const;
113cdf0e10cSrcweir     virtual bool        inq_CheckParameters() const;
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     // Locals
116cdf0e10cSrcweir     typedef StringVector::const_iterator            opt_iter;
117cdf0e10cSrcweir     typedef std::vector< DYN command::Command* >    CommandList;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     void                load_IncludedCommands(
120cdf0e10cSrcweir                             StringVector &      out,
121cdf0e10cSrcweir                             const char *        i_filePath );
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     void                do_clVerbose(
124cdf0e10cSrcweir                             opt_iter &          it,
125cdf0e10cSrcweir                             opt_iter            itEnd );
126cdf0e10cSrcweir     void                do_clParse(
127cdf0e10cSrcweir                             opt_iter &          it,
128cdf0e10cSrcweir                             opt_iter            itEnd );
129cdf0e10cSrcweir     void                do_clCreateHtml(
130cdf0e10cSrcweir                             opt_iter &          it,
131cdf0e10cSrcweir                             opt_iter            itEnd );
132cdf0e10cSrcweir     void                do_clSinceFile(
133cdf0e10cSrcweir                             opt_iter &          it,
134cdf0e10cSrcweir                             opt_iter            itEnd );
135cdf0e10cSrcweir 
136cdf0e10cSrcweir //    void                do_clCreateXml(
137cdf0e10cSrcweir //                            opt_iter &          it,
138cdf0e10cSrcweir //                            opt_iter            itEnd );
139cdf0e10cSrcweir //    void                do_clLoad(
140cdf0e10cSrcweir //                            opt_iter &          it,
141cdf0e10cSrcweir //                            opt_iter            itEnd );
142cdf0e10cSrcweir //    void                do_clSave(
143cdf0e10cSrcweir //                            opt_iter &          it,
144cdf0e10cSrcweir //                            opt_iter            itEnd );
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     void                sort_Commands();
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	// DATA
149cdf0e10cSrcweir     uintt               nDebugStyle;
150cdf0e10cSrcweir     Dyn<command::SinceTagTransformationData>
151cdf0e10cSrcweir                         pSinceTransformator;
152cdf0e10cSrcweir 
153cdf0e10cSrcweir     CommandList         aCommands;
154cdf0e10cSrcweir     bool                bInitOk;
155cdf0e10cSrcweir     command::CreateHtml *
156cdf0e10cSrcweir                         pCommand_CreateHtml;
157cdf0e10cSrcweir 
158*b32aa359SDamjan Jovanovic     ::std::vector<String> ignoreDefines;
159*b32aa359SDamjan Jovanovic 
160cdf0e10cSrcweir     String              sExternRoot;
161cdf0e10cSrcweir     String              sExternNamespace;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir     mutable Dyn<ary::Repository>
164cdf0e10cSrcweir                         pReposy;
165cdf0e10cSrcweir     bool                bCpp;
166cdf0e10cSrcweir     bool                bIdl;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     static CommandLine *
169cdf0e10cSrcweir                         pTheInstance_;
170cdf0e10cSrcweir };
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 
174cdf0e10cSrcweir // IMPLEMENTATION
175cdf0e10cSrcweir inline bool
DebugStyle_ShowText() const176cdf0e10cSrcweir CommandLine::DebugStyle_ShowText() const
177cdf0e10cSrcweir     { return (nDebugStyle & 2) != 0; }
178cdf0e10cSrcweir inline bool
DebugStyle_ShowStoredObjects() const179cdf0e10cSrcweir CommandLine::DebugStyle_ShowStoredObjects() const
180cdf0e10cSrcweir     { return (nDebugStyle & 4) != 0; }
181cdf0e10cSrcweir inline bool
DebugStyle_ShowTokens() const182cdf0e10cSrcweir CommandLine::DebugStyle_ShowTokens() const
183cdf0e10cSrcweir     { return (nDebugStyle & 1) != 0; }
184cdf0e10cSrcweir 
185cdf0e10cSrcweir }   // namespace autodoc
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 
188cdf0e10cSrcweir inline bool
DEBUG_ShowText()189cdf0e10cSrcweir DEBUG_ShowText()
190cdf0e10cSrcweir     { return autodoc::CommandLine::Get_().DebugStyle_ShowText(); }
191cdf0e10cSrcweir inline bool
DEBUG_ShowStoring()192cdf0e10cSrcweir DEBUG_ShowStoring()
193cdf0e10cSrcweir     { return autodoc::CommandLine::Get_().DebugStyle_ShowStoredObjects(); }
194cdf0e10cSrcweir inline bool
DEBUG_ShowTokens()195cdf0e10cSrcweir DEBUG_ShowTokens()
196cdf0e10cSrcweir     { return autodoc::CommandLine::Get_().DebugStyle_ShowTokens(); }
197cdf0e10cSrcweir 
198cdf0e10cSrcweir #endif
199cdf0e10cSrcweir 
200