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