diff options
36 files changed, 2012 insertions, 1336 deletions
diff --git a/autodoc/inc/ary/ary.hxx b/autodoc/inc/ary/ary.hxx index 6e0fb9f4b1be..6540cebd08da 100644 --- a/autodoc/inc/ary/ary.hxx +++ b/autodoc/inc/ary/ary.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ary.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:10:14 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,17 +74,17 @@ namespace ary { class Command; -#if 0 // Version 2.2 -// namespace cpp -// { -// class Gate; -// } -#endif // Version 2.2 namespace idl { class Gate; } + namespace cpp + { + class RwGate; + class DisplayGate; + } + namespace n22 { @@ -95,7 +95,8 @@ namespace n22 Create and destroy the repository and give access to the "Gates" for different tasks. - @collab ::ary::cpp::Gate + @collab ::ary::cpp::DisplayGate + @collab ::ary::cpp::RwGate @collab ::ary::idl::Gate */ @@ -104,8 +105,7 @@ class Repository public: // LIFECYCLE virtual ~Repository() { } - static Repository & Create_( - const String & i_sName ); /// May be 0. Then a default is used. + static Repository & Create_(); static Repository & The_(); static void Destroy_(); /// Destroys the Repository. @@ -115,28 +115,31 @@ class Repository // INQUIRY const String & Name() const; + bool HasIdl() const; + bool HasCpp() const; const ::ary::idl::Gate & Gate_Idl() const; + const ary::cpp::DisplayGate & + Gate_Cpp() const; // ACCESS ::ary::idl::Gate & Gate_Idl(); - -#if 0 // Version 2.2 -// const cpp::Gate & Gate_Cpp() const; -// cpp::Gate & Gate_Cpp(); -#endif // Version 2.2 - + ::ary::cpp::RwGate & + Gate_Cpp(); + void Set_Name( + const String & i_sName ); private: // Locals virtual void do_Perform(::ary::Command & io_rCommand) = 0; virtual const String & inq_Name() const = 0; + virtual bool inq_HasIdl() const = 0; + virtual bool inq_HasCpp() const = 0; virtual const ::ary::idl::Gate & inq_Gate_Idl() const = 0; + virtual const ::ary::cpp::DisplayGate & + inq_Gate_Cpp() const = 0; virtual ::ary::idl::Gate & access_Gate_Idl() = 0; - -#if 0 // Version 2.2 -// virtual const cpp::Gate & inq_Gate_Cpp() const = 0; -// virtual cpp::Gate & access_Gate_Cpp() = 0; -#endif // Version 2.2 + virtual ::ary::cpp::RwGate & access_Gate_Cpp() = 0; + virtual void do_Set_Name(const String & i_sName) = 0; }; @@ -151,34 +154,36 @@ inline const String & Repository::Name() const { return inq_Name(); } +inline bool +Repository::HasIdl() const + { return inq_HasIdl(); } + +inline bool +Repository::HasCpp() const + { return inq_HasCpp(); } + inline const ::ary::idl::Gate & Repository::Gate_Idl() const { return inq_Gate_Idl(); } +inline const cpp::DisplayGate & +Repository::Gate_Cpp() const + { return inq_Gate_Cpp(); } + inline ::ary::idl::Gate & Repository::Gate_Idl() { return access_Gate_Idl(); } -#if 0 // Version 2.2 -/* -inline const cpp::Gate & -Repository::Gate_Cpp() const - { return inq_Gate_Cpp(); } -inline cpp::Gate & +inline cpp::RwGate & Repository::Gate_Cpp() { return access_Gate_Cpp(); } -*/ -#endif // Version 2.2 - +inline void +Repository::Set_Name( const String & i_sName ) + { do_Set_Name(i_sName); } } // namespace n22 - namespace cpp - { - class RwGate; - class DisplayGate; - } class IdGenerator; @@ -201,7 +206,6 @@ class Repository // LIFECYCLE virtual ~Repository() { } static Repository & Create_( - const udmstri & i_sName, DYN IdGenerator * let_dpIds ); /// May be 0. Then a default is used. static Repository & The_(); static void Destroy_(); /// Destroys the Repository. diff --git a/autodoc/inc/ary/idl/i_ce2s.hxx b/autodoc/inc/ary/idl/i_ce2s.hxx index aabd63d48e4b..7a627091f5d8 100644 --- a/autodoc/inc/ary/idl/i_ce2s.hxx +++ b/autodoc/inc/ary/idl/i_ce2s.hxx @@ -2,9 +2,9 @@ * * $RCSfile: i_ce2s.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:11:08 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,11 +90,13 @@ class Ce_2s RCid i_nCeClass ); // OPERATIONS void Add_Link2DescriptionInManual( - const String & i_link ) - { aDescriptionsInManual.push_back(i_link); } + const String & i_link, + const String & i_linkUI ) + { aDescriptionsInManual.push_back(i_link); aDescriptionsInManual.push_back(i_linkUI); } void Add_Link2RefInManual( - const String & i_link ) - { aRefsInManual.push_back(i_link); } + const String & i_link, + const String & i_linkUI ) + { aRefsInManual.push_back(i_link); aRefsInManual.push_back(i_linkUI); } std::vector<Ce_id> & Access_List( int i_indexOfList ); diff --git a/autodoc/inc/autodoc/prs_code.hxx b/autodoc/inc/autodoc/prs_code.hxx index 9c4ede5c90ba..c132cf41dc8a 100644 --- a/autodoc/inc/autodoc/prs_code.hxx +++ b/autodoc/inc/autodoc/prs_code.hxx @@ -2,9 +2,9 @@ * * $RCSfile: prs_code.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:16 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -99,7 +99,8 @@ class CodeParser_Ifc virtual void Run( const udmstri & i_sProjectName, - csv::ploc::Path & i_rProjectRootDirectory, + const csv::ploc::Path & + i_rProjectRootDirectory, const autodoc::FileCollector_Ifc & i_rFiles ) = 0; }; diff --git a/autodoc/inc/display/corframe.hxx b/autodoc/inc/display/corframe.hxx index 108025ce8184..29102e3fbb92 100644 --- a/autodoc/inc/display/corframe.hxx +++ b/autodoc/inc/display/corframe.hxx @@ -2,9 +2,9 @@ * * $RCSfile: corframe.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:12:31 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -79,8 +79,10 @@ namespace display class CorporateFrame { public: + // LIFECYCLE virtual ~CorporateFrame() {} + // INQUIRY virtual DYN Html_Image * LogoSrc() const = 0; virtual const char * @@ -88,7 +90,16 @@ class CorporateFrame virtual const char * CopyrightText() const = 0; - virtual const char * CssStyle() const = 0; + virtual const char * + CssStyle() const = 0; + virtual const char * + DevelopersGuideHtmlRoot() const = 0; + virtual bool SimpleLinks() const = 0; + + // ACCESS + virtual void Set_DevelopersGuideHtmlRoot( + const String & i_directory ) = 0; + virtual void Set_SimpleLinks() = 0; }; diff --git a/autodoc/inc/parser/unoidl.hxx b/autodoc/inc/parser/unoidl.hxx index 4e085f48059c..296d18191a59 100644 --- a/autodoc/inc/parser/unoidl.hxx +++ b/autodoc/inc/parser/unoidl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: unoidl.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:12:32 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,10 +87,10 @@ namespace autodoc { -class Uidl_Parser : public ::CodeParser +class IdlParser : public ::CodeParser { public: - Uidl_Parser( + IdlParser( ary::n22::Repository & io_rRepository ); virtual void Run( diff --git a/autodoc/source/ary/inc/reposy.hxx b/autodoc/source/ary/inc/reposy.hxx index 9b109ce1dfaa..62c63023e673 100644 --- a/autodoc/source/ary/inc/reposy.hxx +++ b/autodoc/source/ary/inc/reposy.hxx @@ -2,9 +2,9 @@ * * $RCSfile: reposy.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:13:46 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,8 +110,7 @@ class RepositoryCenter : public ::ary::n22::Repository { public: // LIFECYCLE - RepositoryCenter( - const String & i_sDisplayedName ); + RepositoryCenter(); virtual ~RepositoryCenter(); // OPERATIONS @@ -120,15 +119,16 @@ class RepositoryCenter : public ::ary::n22::Repository action::Statistic & io_rCommand ); private: // Interface Repository: - virtual void do_Perform( ::ary::Command & io_rCommand); - virtual const String & inq_Name() const; - virtual const idl::Gate & inq_Gate_Idl() const; - virtual idl::Gate & access_Gate_Idl(); - -#if 0 // Version 2.2 - virtual const cpp::Gate & inq_Gate_Cpp() const; - virtual cpp::Gate & access_Gate_Cpp(); -#endif // Version 2.2 + virtual void do_Perform( ::ary::Command & io_rCommand); + virtual const String & inq_Name() const; + virtual bool inq_HasIdl() const; + virtual bool inq_HasCpp() const; + virtual const idl::Gate & inq_Gate_Idl() const; + virtual const ::ary::cpp::DisplayGate & + inq_Gate_Cpp() const; + virtual idl::Gate & access_Gate_Idl(); + virtual ::ary::cpp::RwGate& access_Gate_Cpp(); + virtual void do_Set_Name(const String & i_sName); // Local @@ -164,10 +164,12 @@ class RepositoryCenter : public Repository public: // LIFECYCLE RepositoryCenter( - const udmstri & i_sName, DYN IdGenerator & let_drIds ); virtual ~RepositoryCenter(); + bool HasCpp() const; + void Set_Name( + const String & i_name ); private: // Interface Repository: diff --git a/autodoc/source/ary/kernel/reposy.cxx b/autodoc/source/ary/kernel/reposy.cxx index 419eb90491cf..b74bae5f1e7c 100644 --- a/autodoc/source/ary/kernel/reposy.cxx +++ b/autodoc/source/ary/kernel/reposy.cxx @@ -2,9 +2,9 @@ * * $RCSfile: reposy.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:11 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -84,6 +84,11 @@ namespace ary { +namespace +{ + static Dyn<RepositoryCenter> pTheOldInstance_(0); +} + namespace n22 { @@ -99,19 +104,24 @@ namespace } Repository & -Repository::Create_( const String & i_sName ) +Repository::Create_() { if ( pTheInstance_ ) throw X_Ary(X_Ary::x_MultipleRepository); - pTheInstance_ = new RepositoryCenter( i_sName ); + pTheInstance_ = new RepositoryCenter; + + // KORR_FUTURE + // Create the Cpp repository: + ::ary::Repository::Create_(0); + return *pTheInstance_; } Repository & Repository::The_() { - if ( pTheInstance_ ) + if ( NOT pTheInstance_ ) throw X_Ary(X_Ary::x_MissingRepository); return *pTheInstance_; @@ -121,14 +131,18 @@ void Repository::Destroy_() { pTheInstance_ = 0; + + // KORR_FUTURE + // Destroythe Cpp repository: + ::ary::Repository::Destroy_(); } //***************** RepositoryCenter ************// -RepositoryCenter::RepositoryCenter( const String & i_sName ) - : sDisplayedName(i_sName), +RepositoryCenter::RepositoryCenter() + : sDisplayedName(), aLocation(), #if 0 // Version 2.2 pCppPartition(), @@ -165,12 +179,29 @@ RepositoryCenter::inq_Name() const return sDisplayedName; } +bool +RepositoryCenter::inq_HasIdl() const +{ + return bool(pIdlPartition); +} + +bool +RepositoryCenter::inq_HasCpp() const +{ + return pTheOldInstance_->HasCpp(); +} + const ::ary::idl::Gate & RepositoryCenter::inq_Gate_Idl() const { return const_cast< RepositoryCenter& >(*this).access_Gate_Idl(); } +const ::ary::cpp::DisplayGate & +RepositoryCenter::inq_Gate_Cpp() const +{ + return pTheOldInstance_->DisplayGate_Cpp(); +} ::ary::idl::Gate & RepositoryCenter::access_Gate_Idl() @@ -181,6 +212,20 @@ RepositoryCenter::access_Gate_Idl() return pIdlPartition->TheGate(); } +::ary::cpp::RwGate & +RepositoryCenter::access_Gate_Cpp() +{ + return pTheOldInstance_->RwGate_Cpp(); +} + +void +RepositoryCenter::do_Set_Name(const String & i_sName) +{ + sDisplayedName = i_sName; + pTheOldInstance_->Set_Name(i_sName); +} + + #if 0 // Version 2.2 /* @@ -306,59 +351,53 @@ RepositoryCenter::inq_Gate_Cpp() const -namespace -{ - static Dyn<RepositoryCenter> pTheInstance_(0); -} struct RepositoryCenter::CheshireCat { // DATA - udmstri sName; + String sName; Dyn<store::Storage> pStorage; Dyn<Storage_Ifc> pStorage_Ifc; Dyn<IdGenerator> pIdGenerator; Dyn<cpp::Gate> pGate_Cpp; Dyn<loc::Gate> pGate_Locations; + bool bHasCppContent; CheshireCat( - const udmstri & i_sName, DYN IdGenerator & let_drIds ); ~CheshireCat(); }; Repository & -Repository::Create_( const udmstri & i_sName, - DYN IdGenerator * let_dpIds ) +Repository::Create_( DYN IdGenerator * let_dpIds ) { - csv_assert( NOT pTheInstance_ ); + csv_assert( NOT pTheOldInstance_ ); DYN IdGenerator * dpIds = let_dpIds != 0 ? let_dpIds : new Std_IdGenerator; - pTheInstance_ = new RepositoryCenter( i_sName, *dpIds ); - return *pTheInstance_; + pTheOldInstance_ = new RepositoryCenter( *dpIds ); + return *pTheOldInstance_; } Repository & Repository::The_() { - csv_assert( pTheInstance_ ); - return *pTheInstance_; + csv_assert( pTheOldInstance_ ); + return *pTheOldInstance_; } void Repository::Destroy_() { - pTheInstance_ = 0; + pTheOldInstance_ = 0; } -RepositoryCenter::RepositoryCenter( const udmstri & i_sName, - DYN IdGenerator & let_drIds ) - : pi( new CheshireCat(i_sName, let_drIds) ) +RepositoryCenter::RepositoryCenter( DYN IdGenerator & let_drIds ) + : pi( new CheshireCat(let_drIds) ) { } @@ -366,6 +405,18 @@ RepositoryCenter::~RepositoryCenter() { } +bool +RepositoryCenter::HasCpp() const +{ + return pi->bHasCppContent; +} + +void +RepositoryCenter::Set_Name( const String & i_name ) +{ + pi->sName = i_name; +} + const cpp::DisplayGate & RepositoryCenter::inq_DisplayGate_Cpp() const { @@ -381,19 +432,20 @@ RepositoryCenter::inq_Name() const cpp::RwGate & RepositoryCenter::access_RwGate_Cpp() { + pi->bHasCppContent = true; return *pi->pGate_Cpp; } RepositoryCenter:: -CheshireCat::CheshireCat( const udmstri & i_sName, - DYN IdGenerator & let_drIds ) - : sName(i_sName), +CheshireCat::CheshireCat( DYN IdGenerator & let_drIds ) + : sName(), pStorage(0), pStorage_Ifc(0), pIdGenerator( &let_drIds ), pGate_Cpp(0), - pGate_Locations(0) + pGate_Locations(0), + bHasCppContent(false) { pStorage = new store::Storage; pStorage_Ifc = new Storage_Ifc( *pStorage ); diff --git a/autodoc/source/display/html/cfrstd.cxx b/autodoc/source/display/html/cfrstd.cxx index d4d726e99531..2dc83042ed66 100644 --- a/autodoc/source/display/html/cfrstd.cxx +++ b/autodoc/source/display/html/cfrstd.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfrstd.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:21 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -165,7 +165,11 @@ const char * const C_sStdStyle = } // anonymous namespace - +StdFrame::StdFrame() + : sDevelopersGuideHtmlRoot(), + bSimpleLinks(false) +{ +} DYN Html_Image * StdFrame::LogoSrc() const @@ -203,3 +207,34 @@ StdFrame::CssStyle() const return C_sStdStyle; } +const char * +StdFrame::DevelopersGuideHtmlRoot() const +{ + return sDevelopersGuideHtmlRoot; +} + +bool +StdFrame::SimpleLinks() const +{ + return bSimpleLinks; +} + +void +StdFrame::Set_DevelopersGuideHtmlRoot( const String & i_directory ) +{ + if (NOT i_directory.empty()) + { + if (i_directory.char_at(i_directory.length()-1) == '/') + { + sDevelopersGuideHtmlRoot.assign(i_directory,i_directory.length()-1); + return; + } + } + sDevelopersGuideHtmlRoot = i_directory; +} + +void +StdFrame::Set_SimpleLinks() +{ + bSimpleLinks = true; +} diff --git a/autodoc/source/display/idl/hfi_linklist.cxx b/autodoc/source/display/idl/hfi_linklist.cxx index 95401bd66ec7..63ff99d104af 100644 --- a/autodoc/source/display/idl/hfi_linklist.cxx +++ b/autodoc/source/display/idl/hfi_linklist.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_linklist.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:33 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -116,7 +116,6 @@ HF_CommentedLink_Table::Add_Line() << new Html::WidthAttr("30%") << new Xml::AnAttribute("valign","top") ); pCurCommentColumn = & rRow.AddCell(); - } Xml::Element & diff --git a/autodoc/source/display/idl/hfi_navibar.cxx b/autodoc/source/display/idl/hfi_navibar.cxx index a60fec090c17..bfa10fff4a10 100644 --- a/autodoc/source/display/idl/hfi_navibar.cxx +++ b/autodoc/source/display/idl/hfi_navibar.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_navibar.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:38 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,11 +121,11 @@ HF_IdlNavigationBar::Produce_CeMainRow( const client & i_ce ) const StringVector & rManualDescrs = i_ce.Secondaries().Links2DescriptionInManual(); - if (rManualDescrs.size() == 1) + if (rManualDescrs.size() == 2) { aNaviMain.Add_StdItem(C_sManual, Env().Link2Manual( rManualDescrs.front() )); } - else if (rManualDescrs.size() > 1) + else if (rManualDescrs.size() > 2) { aNaviMain.Add_StdItem(C_sManual, C_sLocalManualLinks); } diff --git a/autodoc/source/display/idl/hfi_tag.cxx b/autodoc/source/display/idl/hfi_tag.cxx index 72036beadb4c..a0dd689b4798 100644 --- a/autodoc/source/display/idl/hfi_tag.cxx +++ b/autodoc/source/display/idl/hfi_tag.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_tag.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:44 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -140,9 +140,9 @@ HF_IdlTag::Display_SeeAlsoAtTag( const csi::dsapi::DT_SeeAlsoAtTag & i_rTag ) csv_assert( pTitleOut != 0 ); *pTitleOut << "See also"; - HF_IdlTypeText aLinkText(Env(),aTextOut.CurOut(),true); + HF_IdlTypeText aLinkText(Env(),aTextOut.CurOut(),true, &aTextOut.ScopeGivingCe()); aLinkText.Produce_byData( i_rTag.LinkText() ); -// aTextOut.Create_LinkToBeFound(i_rTag.LinkText(),true); + aTextOut.CurOut() << new Html::LineBreak; PutText_Out( i_rTag.Text() ); } @@ -301,6 +301,16 @@ HF_IdlDocuTextDisplay::Display_EOL() void HF_IdlDocuTextDisplay::CreateTypeLink() { + if (strchr(sLinkToken,':') != 0) + { + Cerr() << "Warning: Qualified name (probably member) \"" + << sLinkToken + << "\" found in <type> tag in " + << Env().CurPageCe_AsText() + << Endl(); + CurOut() << sLinkToken; + return; + } HF_IdlTypeText aLink(Env(), CurOut(), true, &ScopeGivingCe()); aLink.Produce_LinkInDocu(sScope, sLinkToken, String::Null_()); } @@ -312,7 +322,7 @@ HF_IdlDocuTextDisplay::CreateMemberLink() HF_IdlTypeText aLink(Env(), CurOut(), true, &ScopeGivingCe()); const char * - sSplit = strstr(sLinkToken,"::"); + sSplit = strchr(sLinkToken,':'); if (sSplit != 0) { diff --git a/autodoc/source/display/idl/hfi_typetext.cxx b/autodoc/source/display/idl/hfi_typetext.cxx index 2106d803a50e..e316173ac56d 100644 --- a/autodoc/source/display/idl/hfi_typetext.cxx +++ b/autodoc/source/display/idl/hfi_typetext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_typetext.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:48 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -168,6 +168,7 @@ HF_IdlTypeText::Produce_byData( const String & i_sFullName ) const { // SYNTAX_ERR, but rather logical error: Missing module. CurOut() << i_sFullName; + errorOut_UnresolvedLink(i_sFullName); return; } @@ -178,6 +179,7 @@ HF_IdlTypeText::Produce_byData( const String & i_sFullName ) const if (sTypeEnd == 0) { // SYNTAX_ERR CurOut() << i_sFullName; + errorOut_UnresolvedLink(i_sFullName); return; } @@ -191,14 +193,20 @@ HF_IdlTypeText::Produce_byData( const String & i_sFullName ) const } csv::erase_container(aModule_); - bool bFound = // KORR : Check the semantics of this, see if ce really exists in any case? + bool bFound = // KORR : Check the semantics of this, see if ce really exists, if it is a member? Env().Data().Search_Ce( aModule_, sCe,sMember, sTypeText, *pScopeModule ); if (NOT bFound) { + if (strchr(sTypeText,':') == 0) + { + Produce_LocalLinkInDocu(sTypeText); + return; + } CurOut() << i_sFullName; + errorOut_UnresolvedLink(i_sFullName); return; } @@ -224,6 +232,7 @@ HF_IdlTypeText::Produce_LinkInDocu( const String & i_scope, CurOut() << i_scope << "::" << i_name; if (NOT i_member.empty()) CurOut() << "::" << i_member; + errorOut_UnresolvedLink(i_scope,i_name,i_member); return; } @@ -237,6 +246,7 @@ HF_IdlTypeText::Produce_LinkInDocu( const String & i_scope, CurOut() << i_scope << "::" << i_name; if (NOT i_member.empty()) CurOut() << "::" << i_member; + errorOut_UnresolvedLink(i_scope,i_name,i_member); return; } produce_FromStd(aModule_, i_name, i_member, 0, exists_yes); @@ -252,12 +262,19 @@ HF_IdlTypeText::Produce_LocalLinkInDocu( const String & i_member ) const csv_assert(referingCe() != 0); if ( referingModule() == Env().Linker().Search_CurModule() ) { + StreamLock slLink(200); + if (referingCe()->SightLevel() == ary::idl::sl_Member) + { + slLink() << "#" << i_member; + } + else + { + slLink() << referingCe()->LocalName() + << ".html#" + << i_member; + } CurOut() - >> *new Html::Link( StreamLock(200)() - << referingCe()->LocalName() - << ".html#" - << i_member - << c_str ) + >> *new Html::Link(slLink().c_str()) << i_member; return; } @@ -340,6 +357,11 @@ HF_IdlTypeText::produce_FromStd( const StringVector & i_module, bool bHasCeOrName = NOT i_ce.empty(); + if (i_ceExists == exists_no) + { + errorOut_UnresolvedLink(i_module, i_ce, i_member); + } + if (i_sequenceCount > 0) start_Sequence(i_sequenceCount); @@ -568,6 +590,59 @@ HF_IdlTypeText::finish_Sequence( int i_count ) const } } +void +HF_IdlTypeText::errorOut_UnresolvedLink( const char * i_name ) const +{ + Cerr() << "\nWarning: Unresolved Link \"" + << i_name + << "\" in " + << Env().CurPageCe_AsText() + << Endl(); +} + +void +HF_IdlTypeText::errorOut_UnresolvedLink( const StringVector & i_module, + const String & i_ce, + const String & i_member ) const +{ + StreamLock slName(500); + + if (i_module.size() > 0) + { + slName().operator_join(i_module.begin(), i_module.end(), "::"); + if (NOT i_ce.empty()) + slName() << "::"; + } + if (NOT i_ce.empty()) + { + slName() << i_ce; + if (NOT i_member.empty()) + slName() << "::" << i_member; + } + errorOut_UnresolvedLink(slName().c_str()); +} + +void +HF_IdlTypeText::errorOut_UnresolvedLink( const String & i_module, + const String & i_ce, + const String & i_member ) const +{ + StreamLock slName(500); + + if (i_module.size() > 0) + { + slName() << i_module; + if (NOT i_ce.empty()) + slName() << "::"; + } + if (NOT i_ce.empty()) + { + slName() << i_ce; + if (NOT i_member.empty()) + slName() << "::" << i_member; + } + errorOut_UnresolvedLink(slName().c_str()); +} diff --git a/autodoc/source/display/idl/hfi_typetext.hxx b/autodoc/source/display/idl/hfi_typetext.hxx index 1b2158de9577..9e9c6e0ff81c 100644 --- a/autodoc/source/display/idl/hfi_typetext.hxx +++ b/autodoc/source/display/idl/hfi_typetext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_typetext.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:49 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,6 +135,17 @@ class HF_IdlTypeText : public HtmlFactory_Idl int i_count ) const; void finish_Sequence( int i_count ) const; + void errorOut_UnresolvedLink( + const char * i_name ) const; + void errorOut_UnresolvedLink( + const StringVector & + i_module, + const String & i_ce, + const String & i_member ) const; + void errorOut_UnresolvedLink( + const String & i_module, + const String & i_ce, + const String & i_member ) const; const ary::idl::Module * referingModule() const; const client * referingCe() const; diff --git a/autodoc/source/display/idl/hfi_xrefpage.cxx b/autodoc/source/display/idl/hfi_xrefpage.cxx index 1a294f6b03e7..9ef18b8ef4ed 100644 --- a/autodoc/source/display/idl/hfi_xrefpage.cxx +++ b/autodoc/source/display/idl/hfi_xrefpage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hfi_xrefpage.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:49 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -125,20 +125,24 @@ HF_IdlXrefs::Write_ManualLinks( const client & i_ce ) const Xml::Element & rOutCell = aList.Add_Row() >>* new Html::TableCell; + csv_assert(rLinks2Refs.size() % 2 == 0); for ( StringVector::const_iterator it = rLinks2Refs.begin(); it != rLinks2Refs.end(); ++it ) { - rOutCell - >> *new Html::Link( Env().Link2Manual(*it)) - << *it; + Xml::Element & + rLink = rOutCell >> *new Html::Link( Env().Link2Manual(*it)); + if ( (*(it+1)).empty() ) + rLink << *it; + else + rLink << *(it+1); rOutCell << new Html::LineBreak << C_sCRLF; + ++it; } // end for CurOut() << new Html::HorizontalLine(); - } void diff --git a/autodoc/source/display/idl/hi_ary.cxx b/autodoc/source/display/idl/hi_ary.cxx index 8852ffa3045e..27dffa31aee0 100644 --- a/autodoc/source/display/idl/hi_ary.cxx +++ b/autodoc/source/display/idl/hi_ary.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hi_ary.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:51 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:57 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -205,17 +205,17 @@ AryAccess::Search_Ce( StringVector & o_module, // Find member: if ( *pNext == 0 ) return true; - if (strchr(pNext,':') != 0) + nextName(pNext, o_memberEntity); + if (strchr(o_memberEntity,':') != 0) return false; // This must not happen in IDL - int nMemberLen = strlen(pNext); + int nMemberLen = o_memberEntity.length(); if ( nMemberLen > 2 ? *(pNext + nMemberLen - 2) == '(' : false ) { - nMemberLen -= 2; + o_memberEntity.assign(o_memberEntity,nMemberLen-2); } - o_memberEntity.assign(pNext,nMemberLen); #if 0 // The following code avoids false links, but is rather expensive diff --git a/autodoc/source/display/idl/hi_env.cxx b/autodoc/source/display/idl/hi_env.cxx index 2987421c9344..a25d9028eeef 100644 --- a/autodoc/source/display/idl/hi_env.cxx +++ b/autodoc/source/display/idl/hi_env.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hi_env.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:52 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,6 +86,7 @@ HtmlEnvironment_Idl::HtmlEnvironment_Idl( const csv::ploc::Path & i_rO pData(new AryAccess(i_rGate)), pOutputTree(new output::Tree), aCurPosition(pOutputTree->Root()), + pCurPageCe(0), pLayout(&i_rLayout), pLinker() { @@ -174,9 +175,30 @@ HtmlEnvironment_Idl::Link2Manual( const String & i_link ) const static StreamStr aLink_(200); aLink_.reset(); aCurPosition.Get_LinkToRoot(aLink_); - aLink_ << "../devman/" + String sDvgRoot(pLayout->DevelopersGuideHtmlRoot()); + if (sDvgRoot.empty()) + sDvgRoot = "../DevelopersGuide"; + aLink_ << sDvgRoot + << "/" << i_link; return aLink_.c_str(); } +String +HtmlEnvironment_Idl::CurPageCe_AsText() const +{ + if (pCurPageCe == 0) + return String::Null_(); + + static StringVector aModule_; + String sCe; + String sDummy; + Data().Get_CeText(aModule_, sCe, sDummy, *pCurPageCe); + StreamLock slCe(500); + if (aModule_.size() > 0) + slCe().operator_join(aModule_.begin(), aModule_.end(), "/"); + if (NOT sCe.empty()) + slCe() << "/" << sCe << ".html"; + return String(slCe().c_str()); +} diff --git a/autodoc/source/display/idl/hi_env.hxx b/autodoc/source/display/idl/hi_env.hxx index aac333cfe2b4..9d8fbed060ab 100644 --- a/autodoc/source/display/idl/hi_env.hxx +++ b/autodoc/source/display/idl/hi_env.hxx @@ -2,9 +2,9 @@ * * $RCSfile: hi_env.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:54 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,7 @@ namespace ary namespace idl { class Gate; + class CodeEntity; } } namespace display @@ -124,7 +125,10 @@ class HtmlEnvironment_Idl void Goto_DirectoryLevelUp(); void Set_CurFile( const String & i_fileName ); - + void Set_CurPageCe( + const ary::idl::CodeEntity * + i_ce ) + { pCurPageCe = i_ce; } // INQUIRY const AryAccess & Data() const { return *pData; } const char * Link2Manual( @@ -148,6 +152,8 @@ class HtmlEnvironment_Idl StreamStr & o_result, output::Position i_destination ) { CurPosition().Get_LinkTo(o_result, i_destination); } + String CurPageCe_AsText() const; + // ACCESS output::Tree & OutputTree() { return *pOutputTree; } @@ -166,6 +172,8 @@ class HtmlEnvironment_Idl Dyn<output::Tree> pOutputTree; mutable output::Position aCurPosition; + const ary::idl::CodeEntity * + pCurPageCe; const display::CorporateFrame * pLayout; diff --git a/autodoc/source/display/idl/hi_factory.cxx b/autodoc/source/display/idl/hi_factory.cxx index ed9343b43e0f..1e04866a0537 100644 --- a/autodoc/source/display/idl/hi_factory.cxx +++ b/autodoc/source/display/idl/hi_factory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hi_factory.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:55 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -221,13 +221,18 @@ HtmlFactory_Idl::write_ManualLinks( Xml::Element & o_screen, HF_DocEntryList aDocuList( o_screen ); aDocuList.Produce_Term("Developer Manual"); + csv_assert(rLinks2Descrs.size() % 2 == 0); for ( StringVector::const_iterator it = rLinks2Descrs.begin(); it != rLinks2Descrs.end(); ++it ) { - aDocuList.Produce_Definition() - >> *new Html::Link( Env().Link2Manual(*it)) - << *it; + Xml::Element & + rLink = aDocuList.Produce_Definition() >> *new Html::Link( Env().Link2Manual(*it)); + if ( (*(it+1)).empty() ) + rLink << *it; + else + rLink << *(it+1); + ++it; } // end for } diff --git a/autodoc/source/display/idl/hi_main.cxx b/autodoc/source/display/idl/hi_main.cxx index da327f3ec6a7..7382e32c4611 100644 --- a/autodoc/source/display/idl/hi_main.cxx +++ b/autodoc/source/display/idl/hi_main.cxx @@ -2,9 +2,9 @@ * * $RCSfile: hi_main.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:14:59 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -126,12 +126,21 @@ class Guard_CurFile DocuFile_Html & io_client, HtmlEnvironment_Idl & io_env, - const String & i_ceName, + const ary::idl::CodeEntity & + i_ce, + const String & i_titlePrefix ); + Guard_CurFile( /// For Use pages + DocuFile_Html & io_client, + HtmlEnvironment_Idl & + io_env, + const String & i_fileName, const String & i_titlePrefix ); Guard_CurFile( /// For Modules DocuFile_Html & io_client, HtmlEnvironment_Idl & - io_env ); + io_env, + const ary::idl::CodeEntity & + i_ce ); Guard_CurFile( /// For Indices DocuFile_Html & io_client, HtmlEnvironment_Idl & @@ -140,6 +149,8 @@ class Guard_CurFile ~Guard_CurFile(); private: DocuFile_Html & rClient; + HtmlEnvironment_Idl & + rEnv; }; @@ -165,13 +176,14 @@ class Guard_CurFactoryPtr }; -Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, - HtmlEnvironment_Idl & io_env, - const String & i_ceName, - const String & i_titlePrefix ) - : rClient(io_client) -{ - io_env.Set_CurFile( StreamLock(100)() << i_ceName +Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, + HtmlEnvironment_Idl & io_env, + const ary::idl::CodeEntity & i_ce, + const String & i_titlePrefix ) + : rClient(io_client), + rEnv(io_env) +{ // For Ces + io_env.Set_CurFile( StreamLock(100)() << i_ce.LocalName() << ".html" << c_str ); StreamLock aCurFilePath(700); @@ -179,13 +191,37 @@ Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, rClient.EmptyBody(); rClient.SetLocation( aCurFilePath().c_str() ); - rClient.SetTitle( StreamLock(100)() << i_titlePrefix << " " << i_ceName << c_str ); + rClient.SetTitle( StreamLock(100)() << i_titlePrefix << " " << i_ce.LocalName() << c_str ); + + io_env.Set_CurPageCe(&i_ce); } Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, - HtmlEnvironment_Idl & io_env ) - : rClient(io_client) -{ + HtmlEnvironment_Idl & io_env, + const String & i_fileName, + const String & i_titlePrefix ) + : rClient(io_client), + rEnv(io_env) +{ // For Use pages + io_env.Set_CurFile( StreamLock(100)() << i_fileName + << ".html" + << c_str ); + StreamLock aCurFilePath(700); + io_env.Get_CurFilePath(aCurFilePath()); + + rClient.EmptyBody(); + rClient.SetLocation( aCurFilePath().c_str() ); + rClient.SetTitle( StreamLock(100)() << i_titlePrefix << " " << i_fileName << c_str ); + + io_env.Set_CurPageCe(0); +} + +Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, + HtmlEnvironment_Idl & io_env, + const ary::idl::CodeEntity & i_ce ) + : rClient(io_client), + rEnv(io_env) +{ // For Modules io_env.Set_CurFile( output::ModuleFileName() ); StreamLock aCurFilePath(700); io_env.Get_CurFilePath(aCurFilePath()); @@ -193,13 +229,16 @@ Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, rClient.EmptyBody(); rClient.SetLocation( aCurFilePath().c_str() ); rClient.SetTitle( StreamLock(100)() << "Module " << io_env.CurPosition().Name() << c_str ); + + io_env.Set_CurPageCe(&i_ce); } Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, HtmlEnvironment_Idl & io_env, char i_letter ) - : rClient(io_client) -{ + : rClient(io_client), + rEnv(io_env) +{ // For Index pages io_env.Set_CurFile( StreamLock(100)() << "index-" << ( i_letter != '_' ? int(i_letter)-'a'+1 @@ -221,6 +260,7 @@ Guard_CurFile::Guard_CurFile( DocuFile_Html & io_client, Guard_CurFile::~Guard_CurFile() { rClient.CreateFile(); + rEnv.Set_CurPageCe(0); } @@ -262,7 +302,8 @@ void MainDisplay_Idl::do_Module( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, - Env() ); + Env(), + i_ce ); HF_IdlModule aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -316,7 +357,7 @@ MainDisplay_Idl::do_ConstantsGroup( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Constants' Group" ); HF_IdlConstGroup aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -329,7 +370,7 @@ MainDisplay_Idl::do_Singleton( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Singleton" ); HF_IdlSingleton aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -343,7 +384,7 @@ MainDisplay_Idl::do_InterfaceDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Interface" ); HF_IdlInterface aInterface( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aInterface); @@ -356,7 +397,7 @@ MainDisplay_Idl::do_ServiceDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Service" ); HF_IdlService aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -369,7 +410,7 @@ MainDisplay_Idl::do_StructDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Struct" ); HF_IdlStruct aFactory( *pEnv, pMyFile->Body(), false ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -382,7 +423,7 @@ MainDisplay_Idl::do_ExceptionDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Exception" ); HF_IdlStruct aFactory( *pEnv, pMyFile->Body(), true ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -395,7 +436,7 @@ MainDisplay_Idl::do_EnumDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Enum" ); HF_IdlEnum aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); @@ -408,7 +449,7 @@ MainDisplay_Idl::do_TypedefDescr( const ary::idl::CodeEntity & i_ce ) { Guard_CurFile gFile( *pMyFile, Env(), - i_ce.LocalName(), + i_ce, "Typedef" ); HF_IdlTypedef aFactory( *pEnv, pMyFile->Body() ); Guard_CurFactoryPtr gFactory(pCurFactory,aFactory); diff --git a/autodoc/source/display/inc/cfrstd.hxx b/autodoc/source/display/inc/cfrstd.hxx index 6cdef02724c4..8828a964f6dc 100644 --- a/autodoc/source/display/inc/cfrstd.hxx +++ b/autodoc/source/display/inc/cfrstd.hxx @@ -2,9 +2,9 @@ * * $RCSfile: cfrstd.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:12 $ + * last change: $Author: np $ $Date: 2002-11-14 18:01:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,6 +75,10 @@ class StdFrame : public display::CorporateFrame { public: + // LIFECYCLE + StdFrame(); + + // INQUIRY virtual DYN Html_Image * LogoSrc() const; virtual const char * @@ -83,6 +87,18 @@ class StdFrame : public display::CorporateFrame CopyrightText() const; virtual const char * CssStyle() const; + virtual const char * + DevelopersGuideHtmlRoot() const; + virtual bool SimpleLinks() const; + + // ACCESS + virtual void Set_DevelopersGuideHtmlRoot( + const String & i_directory ); + virtual void Set_SimpleLinks(); + + private: + String sDevelopersGuideHtmlRoot; + bool bSimpleLinks; }; diff --git a/autodoc/source/exes/adc_uni/adc_cl.cxx b/autodoc/source/exes/adc_uni/adc_cl.cxx index 226dee45ed8a..83fe2280ea8c 100644 --- a/autodoc/source/exes/adc_uni/adc_cl.cxx +++ b/autodoc/source/exes/adc_uni/adc_cl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: adc_cl.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:26 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,7 +65,14 @@ // NOT FULLY DEFINED SERVICES +#include <algorithm> +#include <cosv/x.hxx> +#include <cosv/file.hxx> +#include <cosv/template/tpltools.hxx> +#include <ary/ary.hxx> +#include <tools/tkpchars.hxx> #include "adc_cmds.hxx" +#include "adc_cmd_parse.hxx" namespace autodoc @@ -270,12 +277,7 @@ const char * const C_sUserGuide = CommandLine::CommandLine() : nDebugStyle(0), - // pCmd_Parse, - // pCmd_Load, - // pCmd_CreateHtml, - // pCmd_CreateXml, - // pCmd_Save, - pCurProject(0), + aCommands(), bInitOk(false) { csv_assert(pTheInstance_ == 0); @@ -284,51 +286,30 @@ CommandLine::CommandLine() CommandLine::~CommandLine() { + csv::erase_container_of_heap_ptrs(aCommands); pTheInstance_ = 0; } -void -CommandLine::SetUpdate( const char * i_sRepositoryDir ) +int +CommandLine::Run() const { - if ( pCmd_Load ) - { - if ( strcmp(pCmd_Load->ReposyDir(), i_sRepositoryDir) != 0 ) - { - StreamLock slMsg(200); - throw command::X_CommandLine( - slMsg() << "Different repository directories with options " - << command::C_opt_Load - << " and " - << command::C_opt_Update - << "." - << c_str ); - } - } - else - { - pCmd_Load = new command::Load(i_sRepositoryDir); - } -} + Cout() << "\nAutodoc version 2.2.1" + << "\n---------------------" + << "\n" << Endl(); -void -CommandLine::SetCurProject( command::S_ProjectData & io_rProject ) -{ - pCurProject = &io_rProject; -} + ary::n22::Repository & + rAry = ary::n22::Repository::Create_(); -command::S_ProjectData & -CommandLine::CurProject() -{ - if (pCurProject == 0) + bool ok = true; + for ( CommandList::const_iterator it = aCommands.begin(); + ok AND it != aCommands.end(); + ++it ) { - if ( NOT pCmd_Parse ) - { - pCmd_Parse = new command::Parse(*this); - } - pCurProject = &pCmd_Parse->CreateDefaultProject(); + ok = (*it)->Run(); } - return *pCurProject; + rAry.Destroy_(); + return ok ? 0 : 1; } const CommandLine & @@ -342,80 +323,66 @@ void CommandLine::do_Init( int argc, char * argv[] ) { + try + { bInitOk = false; + StringVector aParameters; - try + char * * itpEnd = &argv[0] + argc; + for ( char * * itp = &argv[1]; itp != itpEnd; ++itp ) { + if ( strncmp(*itp, "-I:", 3) != 0 ) + aParameters.push_back(String(*itp)); + else + load_IncludedCommands(aParameters, (*itp)+3); + } - char * * itEnd = &argv[0] + argc; - for ( char * * it = &argv[1]; it != itEnd; ) + StringVector::const_iterator itEnd = aParameters.end(); + for ( StringVector::const_iterator it = aParameters.begin(); + it != itEnd; + ) { - if ( strcmp(*it, command::C_opt_Verbose) == 0 ) - { - ++it; - if ( NOT(it != itEnd && **it >= '0' && **it <= '9') ) - { - StreamLock slMsg(200); - throw command::X_CommandLine( - slMsg() << "Missing number after " - << command::C_opt_Verbose - << "." - << c_str ); - } - - nDebugStyle = int(**it - '0'); + if ( *it == command::C_opt_Verbose ) + do_clVerbose(it,itEnd); + else if ( *it == command::C_opt_LangAll + OR *it == command::C_opt_Name + OR *it == command::C_opt_DevmanFile ) + do_clParse(it,itEnd); + else if (*it == command::C_opt_CreateHtml) + do_clCreateHtml(it,itEnd); +// else if (*it == command::C_opt_CreateXml) +// do_clCreateXml(it,itEnd); +// else if (command::C_opt_Load) +// do_clLoad(it,itEnd); +// else if (*it == command::C_opt_Save) +// do_clSave(it,itEnd); + else if (*it == "-h" OR *it == "-?" OR *it == "?") + // Leads to displaying help, because bInitOk stays on false. + return; + else if ( *it == command::C_opt_Parse ) + // Only for backwards compatibility. + // Just ignore "-parse". ++it; - } - else if ( strcmp(*it, command::C_opt_Load) == 0 ) - { - pCmd_Load = new command::Load; - it = pCmd_Load->Init(it, itEnd); - } - else if ( strcmp(*it, command::C_opt_CreateHtml) == 0 ) - { - pCmd_CreateHtml = new command::CreateHtml; - it = pCmd_CreateHtml->Init(it, itEnd); - } - else if ( strcmp(*it, command::C_opt_CreateXml) == 0 ) - { - pCmd_CreateXml = new command::CreateXml; - it = pCmd_CreateXml->Init(it, itEnd); - } - else if ( strcmp(*it, command::C_opt_Save) == 0 ) - { - pCmd_Save = new command::Save; - it = pCmd_Save->Init(it, itEnd); - } else - { - pCmd_Parse = new command::Parse(*this); - char * * result = pCmd_Parse->Init(it, itEnd); - if (result == it) - { - StreamLock slMsg(200); - throw command::X_CommandLine( - slMsg() << "Unknown comand line option: '" - << *it - << "' ." - << c_str ); - } - else - it = result; - } + throw command::X_CommandLine( + StreamLock(200)() << "Unknown commandline option \"" + << *it + << "\"." + << c_str ); } // end for + sort_Commands(); bInitOk = true; - } // end try - catch ( command::X_CommandLine & xxx ) - { - xxx.Report( Cerr() ); - } - catch ( ... ) - { - Cerr() << "Unknown error during command line parsing." << Endl(); - } - + } // end try + catch ( command::X_CommandLine & xxx ) + { + xxx.Report( Cerr() ); + } + catch ( csv::Exception & xxx ) + { + xxx.GetInfo( Cerr() ); + } } void @@ -427,25 +394,146 @@ CommandLine::do_PrintUse() const bool CommandLine::inq_CheckParameters() const { - if ( NOT pCmd_Parse AND NOT pCmd_Load) + if (NOT bInitOk OR aCommands.size() == 0) return false; - if ( pCmd_Parse ) + return true; +} + +void +CommandLine::load_IncludedCommands( StringVector & out, + const char * i_filePath ) +{ + CharacterSource + aIncludedCommands; + csv::File + aFile(i_filePath, csv::CFM_READ); + if (NOT aFile.open()) + { + Cerr() << "Command include file \"" + << i_filePath + << "\" not found." + << Endl(); + throw command::X_CommandLine("Invalid file in option -I:<command-file>."); + } + aIncludedCommands.LoadText(aFile); + aFile.close(); + + bool bInToken = false; + for ( ; NOT aIncludedCommands.IsFinished(); aIncludedCommands.MoveOn() ) { - if ( pCmd_Parse->GlobalLanguageInfo() == 0 ) + if (bInToken) { - Cerr() << "Missing language option (" - << command::C_opt_LangAll - << ") in command line" - << Endl(); - return false; + if (aIncludedCommands.CurChar() <= 32) + { + const char * + pToken = aIncludedCommands.CutToken(); + bInToken = false; + + if ( strncmp(pToken, "-I:", 3) != 0 ) + out.push_back(String(pToken)); + else + load_IncludedCommands(out, pToken+3); + } } - } - if ( NOT pCmd_Save AND NOT pCmd_CreateHtml AND NOT pCmd_CreateXml - AND nDebugStyle == 0 ) - return false; - return bInitOk; + else + { + if (aIncludedCommands.CurChar() > 32) + { + aIncludedCommands.CutToken(); + bInToken = true; + } + } // endif (bInToken) else + } // end while() } +namespace +{ +inline int +v_nr(StringVector::const_iterator it) +{ + return int( *(*it).c_str() ) - int('0'); +} +} // anonymous namespace -} // namespace autodoc +void +CommandLine::do_clVerbose( opt_iter & it, + opt_iter itEnd ) +{ + ++it; + if ( it == itEnd ? true : v_nr(it) < 0 OR v_nr(it) > 7 ) + throw command::X_CommandLine( "Missing or invalid number in -v option." ); + nDebugStyle = v_nr(it); + ++it; +} +void +CommandLine::do_clParse( opt_iter & it, + opt_iter itEnd ) +{ + command::Command * + pCmd_Parse = new command::Parse; + pCmd_Parse->Init(it, itEnd); + aCommands.push_back(pCmd_Parse); +} + +void +CommandLine::do_clCreateHtml( opt_iter & it, + opt_iter itEnd ) +{ + command::Command * + pCmd_CreateHtml = new command::CreateHtml; + pCmd_CreateHtml->Init(it, itEnd); + aCommands.push_back(pCmd_CreateHtml); +} + +//void +//CommandLine::do_clCreateXml( opt_iter & it, +// opt_iter itEnd ) +//{ +// pCmd_CreateXml = new command::CreateXml; +// pCmd_CreateXml->Init(it, itEnd); +//} +// +//void +//CommandLine::do_clLoad( opt_iter & it, +// opt_iter itEnd ) +//{ +// pCmd_Load = new command::Load; +// pCmd_Load->Init(it, itEnd); +//} +// +//void +//CommandLine::do_clSave( opt_iter & it, +// opt_iter itEnd ) +//{ +// pCmd_Save = new command::Save; +// pCmd_Save->Init(it, itEnd); +//} + +namespace +{ + +struct Less_RunningRank +{ + bool operator()( + const command::Command * const & + i1, + const command::Command * const & + i2 ) const + { return i1->RunningRank() < i2->RunningRank(); } +}; + +} // anonymous namespace + + + +void +CommandLine::sort_Commands() +{ + Less_RunningRank aCommandCompare; + std::sort( aCommands.begin(), + aCommands.end(), + aCommandCompare ); +} + +} // namespace autodoc diff --git a/autodoc/source/exes/adc_uni/adc_cmd.hxx b/autodoc/source/exes/adc_uni/adc_cmd.hxx new file mode 100644 index 000000000000..0ed4cdcf2aa7 --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cmd.hxx @@ -0,0 +1,169 @@ +/************************************************************************* + * + * $RCSfile: adc_cmd.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-14 18:02:00 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_ADC_CMD_HXX +#define ADC_ADC_CMD_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <cosv/comdline.hxx> + // COMPONENTS + // PARAMETERS + + +namespace autodoc +{ +namespace command +{ + +/** Context for a command, which can be read from the command line. +*/ +class Context +{ + public: + typedef StringVector::const_iterator opt_iter; + + virtual ~Context() {} + + void Init( + opt_iter & it, + opt_iter itEnd ); + private: + virtual void do_Init( + opt_iter & it, + opt_iter itEnd ) = 0; +}; + +// IMPLEMENTATION +inline void +Context::Init( opt_iter & i_nCurArgsBegin, + opt_iter i_nEndOfAllArgs ) + +{ do_Init(i_nCurArgsBegin, i_nEndOfAllArgs); } + + + +/** Interface for commands, autodoc is able to perform. +*/ +class Command : public Context +{ + public: + /** Running ranks of the commands are to be maintained at one location: + Here! + */ + enum E_Ranks + { + rank_Load = 10, + rank_Parse = 20, + rank_Save = 30, + rank_CreateHtml = 40, + rank_CreateXml = 50 + }; + + + bool Run() const; + int RunningRank() const; + + private: + virtual bool do_Run() const = 0; + virtual int inq_RunningRank() const = 0; +}; + +// IMPLEMENTATION +inline bool +Command::Run() const +{ return do_Run(); } +inline int +Command::RunningRank() const +{ return inq_RunningRank(); } + + + + +/** The exception thrown, if the command line is invalid. +*/ +class X_CommandLine +{ + public: + X_CommandLine( + const char * i_sExplanation ) + : sExplanation(i_sExplanation) {} + + void Report( + ostream & o_rOut ) + { o_rOut << "Error in command line: " + << sExplanation << Endl(); } + private: + String sExplanation; +}; + + + + + +} // namespace command +} // namespace autodoc + + +#endif + diff --git a/autodoc/source/exes/adc_uni/adc_cmd_parse.cxx b/autodoc/source/exes/adc_uni/adc_cmd_parse.cxx new file mode 100644 index 000000000000..3522e1c48e6d --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cmd_parse.cxx @@ -0,0 +1,372 @@ +/************************************************************************* + * + * $RCSfile: adc_cmd_parse.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-14 18:02:00 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + + +#include <precomp.h> +#include "adc_cmd_parse.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/template/tpltools.hxx> +#include "adc_cmds.hxx" +#include "cmd_run.hxx" + + + +namespace autodoc +{ +namespace command +{ + +namespace +{ + +const String C_FileEnding_hxx("*.hxx"); +const String C_FileEnding_h("*.h"); +const String C_FileEnding_idl("*.idl"); +const String C_FileEnding_java("*.java"); + +inline void +CHECK( bool b, const String & text ) +{ + if (NOT b) + throw X_CommandLine( text ); +} + +} // anonymous namespace + + + +//************************** S_LanguageInfo ***********************// + +S_LanguageInfo::~S_LanguageInfo() +{ +} + +void +S_LanguageInfo::do_Init( opt_iter & it, + opt_iter itEnd ) +{ + ++it; // Cur is language. + CHECKOPT( it != itEnd AND + ( *it == C_arg_Cplusplus OR + *it == C_arg_Idl OR + *it == C_arg_Java ), + "language", + C_opt_LangAll ); + + if ( *it == C_arg_Cplusplus ) + eLanguage = cpp; + else if ( *it == C_arg_Idl ) + eLanguage = idl; + else if ( *it == C_arg_Java ) + eLanguage = java; + else + csv_assert(false); + + switch (eLanguage) + { + case cpp: aExtensions.push_back( C_FileEnding_hxx ); + aExtensions.push_back( C_FileEnding_h ); + break; + case idl: aExtensions.push_back( C_FileEnding_idl ); + break; + case java: aExtensions.push_back( C_FileEnding_java ); + break; + // default: do nothing. + } + + ++it; // Cur is next option. +} + +void +S_LanguageInfo::InitExtensions( opt_iter & it, + opt_iter itEnd ) +{ + ++it; + CHECKOPT( it != itEnd AND (*it).char_at(0) == '.', + "extensions", + C_opt_ExtensionsAll ); + + StreamLock slCheck(150); + slCheck() << C_opt_ExtensionsAll + << " used without previous " + << C_opt_LangAll; + + CHECK( eLanguage != none, + slCheck().c_str() ); + + do { + aExtensions.push_back(*it); + ++it; + } while (it != itEnd AND (*it).char_at(0) == '.'); +} + + + +//************************** Parse ***********************// + +Parse::Parse() + : sRepositoryName(), + aGlobalLanguage(), + aProjects(), + sDevelopersManual_RefFilePath() +{ +} + +Parse::~Parse() +{ + csv::erase_container_of_heap_ptrs(aProjects); +} + +void +Parse::do_Init( opt_iter & it, + opt_iter itEnd ) +{ + for ( ; it != itEnd; ) + { + if (*it == C_opt_Name) + do_clName(it, itEnd); + else if (*it == C_opt_LangAll) + aGlobalLanguage.Init(it, itEnd); + else if (*it == C_opt_ExtensionsAll) + aGlobalLanguage.InitExtensions(it, itEnd); + else if (*it == C_opt_DevmanFile) + do_clDevManual(it, itEnd); + else if (*it == C_opt_Project) + do_clProject(it, itEnd); + else if ( *it == C_opt_SourceTree + OR *it == C_opt_SourceDir + OR *it == C_opt_SourceFile ) + do_clDefaultProject(it, itEnd); + else + break; + } // for +} + + +void +Parse::do_clName( opt_iter & it, + opt_iter itEnd ) +{ + ++it; + CHECKOPT( it != itEnd AND (*it).char_at(0) != '-', + "name", + C_opt_Name ); + + sRepositoryName = *it; + ++it; +} + +void +Parse::do_clDevManual( opt_iter & it, + opt_iter itEnd ) +{ + ++it; + CHECKOPT( it != itEnd AND (*it).char_at(0) != '-', + "link file path", + C_opt_DevmanFile ); + sDevelopersManual_RefFilePath = *it; + ++it; +} + +void +Parse::do_clProject( opt_iter & it, + opt_iter itEnd ) +{ + if ( aProjects.size() == 1 ) + { + if ( aProjects.front()->IsDefault() ) + throw X_CommandLine( "Both, named projects and a default project, cannot be used together." ); + } + + S_ProjectData * dpProject = new S_ProjectData(aGlobalLanguage); + ++it; + dpProject->Init(it, itEnd); + aProjects.push_back(dpProject); +} + +void +Parse::do_clDefaultProject( opt_iter & it, + opt_iter itEnd ) +{ + if ( aProjects.size() > 0 ) + { + throw X_CommandLine( "Both, named projects and a default project, cannot be used together." ); + } + + S_ProjectData * dpProject = new S_ProjectData( aGlobalLanguage, + S_ProjectData::default_prj ); + dpProject->Init(it, itEnd); + aProjects.push_back(dpProject); +} + +bool +Parse::do_Run() const +{ + run::Parser + aParser(*this); + return aParser.Perform(); +} + +int +Parse::inq_RunningRank() const +{ + return static_cast<int>(rank_Parse); +} + + + +//************************** S_Sources ***********************// + +void +S_Sources::do_Init( opt_iter & it, + opt_iter itEnd ) +{ + StringVector * + pList = 0; + csv_assert((*it)[0] == '-'); + + for ( ; it != itEnd; ++it) + { + if ((*it)[0] == '-') + { + if (*it == C_opt_SourceTree) + pList = &aTrees; + else if (*it == C_opt_SourceDir) + pList = &aDirectories; + else if (*it == C_opt_SourceFile) + pList = &aFiles; + else + return; + } + else + pList->push_back(*it); + } // end for +} + + + +//************************** S_ProjectData ***********************// + + +S_ProjectData::S_ProjectData( const S_LanguageInfo & i_globalLanguage ) + : sName(), + aRootDirectory(), + aLanguage(i_globalLanguage), + aFiles(), + bIsDefault(false) +{ +} + +S_ProjectData::S_ProjectData( const S_LanguageInfo & i_globalLanguage, + E_Default ) + : sName(), + aRootDirectory("."), + aLanguage(i_globalLanguage), + aFiles(), + bIsDefault(true) +{ +} + +S_ProjectData::~S_ProjectData() +{ +} + +void +S_ProjectData::do_Init( opt_iter & it, + opt_iter itEnd ) +{ + if (NOT IsDefault()) + { + CHECKOPT( it != itEnd AND (*it).char_at(0) != '-', + "name", + C_opt_Project ); + sName = *it; + ++it; + + CHECKOPT( it != itEnd AND (*it).char_at(0) != '-', + "root directory", + C_opt_Project ); + aRootDirectory.Set((*it).c_str(), true); + ++it; + } + + for ( ; it != itEnd; ) + { + if ( *it == C_opt_SourceTree + OR *it == C_opt_SourceDir + OR *it == C_opt_SourceFile ) + aFiles.Init(it, itEnd); +// else if (*it == C_opt_Lang) +// aLanguage.Init(it, itEnd); +// else if (*it == C_opt_Extensions) +// aLanguage.InitExtensions(it, itEnd); + else + break; + } // for +} + +} // namespace command +} // namespace autodoc + + + diff --git a/autodoc/source/exes/adc_uni/adc_cmd_parse.hxx b/autodoc/source/exes/adc_uni/adc_cmd_parse.hxx new file mode 100644 index 000000000000..9018659f2d0d --- /dev/null +++ b/autodoc/source/exes/adc_uni/adc_cmd_parse.hxx @@ -0,0 +1,243 @@ +/************************************************************************* + * + * $RCSfile: adc_cmd_parse.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-14 18:02:01 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ADC_ADC_CMD_PARSE_HXX +#define ADC_ADC_CMD_PARSE_HXX + + + +// USED SERVICES + // BASE CLASSES +#include "adc_cmd.hxx" + // COMPONENTS +#include <cosv/ploc.hxx> + // PARAMETERS + +namespace autodoc +{ +namespace command +{ + +/** A command context which holds the currently parsed programing language + and its valid file extensions. +*/ +struct S_LanguageInfo : public Context +{ + enum E_ProgrammingLanguage + { + none, + cpp, + idl, + java + }; + S_LanguageInfo() + : eLanguage(none), + aExtensions() {} + ~S_LanguageInfo(); + + void InitExtensions( + opt_iter & it, + opt_iter itEnd ); + // DATA + E_ProgrammingLanguage + eLanguage; + StringVector aExtensions; // An empty string is possible and means exactly that: files without extension. + + private: + // Interface Context: + virtual void do_Init( + opt_iter & it, + opt_iter itEnd ); +}; + + +class S_ProjectData; + + +/** A command that parses source code into the Autodoc Repository. +*/ +class Parse : public Command +{ + public: + typedef std::vector< DYN S_ProjectData * > ProjectList; + typedef ProjectList::const_iterator ProjectIterator; + + Parse(); + ~Parse(); + + // INQUIRY + const String & ReposyName() const; + const S_LanguageInfo & + GlobalLanguage() const; + ProjectIterator ProjectsBegin() const; + ProjectIterator ProjectsEnd() const; + const String & DevelopersManual_RefFilePath() const + { return sDevelopersManual_RefFilePath; } + + private: + // Interface Context: + virtual void do_Init( + opt_iter & i_nCurArgsBegin, + opt_iter i_nEndOfAllArgs ); + // Interface Command: + virtual bool do_Run() const; + virtual int inq_RunningRank() const; + + // Locals + void do_clName( + opt_iter & it, + opt_iter itEnd ); + void do_clDevManual( + opt_iter & it, + opt_iter itEnd ); + void do_clProject( + opt_iter & it, + opt_iter itEnd ); + void do_clDefaultProject( + opt_iter & it, + opt_iter itEnd ); + + // DATA + String sRepositoryName; + S_LanguageInfo aGlobalLanguage; + + ProjectList aProjects; + + String sDevelopersManual_RefFilePath; +}; + +inline const String & +Parse::ReposyName() const + { return sRepositoryName; } +inline const S_LanguageInfo & +Parse::GlobalLanguage() const + { return aGlobalLanguage; } +inline Parse::ProjectIterator +Parse::ProjectsBegin() const + { return aProjects.begin(); } +inline Parse::ProjectIterator +Parse::ProjectsEnd() const + { return aProjects.end(); } +//inline const String & +//Parse::DevelopersManual_RefFilePath() const +// { return sDevelopersManual_RefFilePath; } +//inline const String & +//Parse::DevelopersManual_HtmlRoot() const +// { return sDevelopersManual_HtmlRoot; } + + +struct S_Sources : public Context +{ + StringVector aTrees; + StringVector aDirectories; + StringVector aFiles; + + private: + // Interface Context: + virtual void do_Init( + opt_iter & it, + opt_iter itEnd ); +}; + +class S_ProjectData : public Context +{ + public: + enum E_Default { default_prj }; + + S_ProjectData( + const S_LanguageInfo & + i_globalLanguage ); + S_ProjectData( + const S_LanguageInfo & + i_globalLanguage, + E_Default unused ); + ~S_ProjectData(); + + bool IsDefault() const { return bIsDefault; } + const String & Name() const { return sName; } + const csv::ploc::Path & + RootDirectory() const { return aRootDirectory; } + const S_LanguageInfo & + Language() const { return aLanguage; } + const S_Sources Sources() const { return aFiles; } + + private: + // Interface Context: + virtual void do_Init( + opt_iter & it, + opt_iter itEnd ); + // Locals + + // DATA + String sName; + csv::ploc::Path aRootDirectory; + S_LanguageInfo aLanguage; + S_Sources aFiles; + bool bIsDefault; +}; + + +} // namespace command +} // namespace autodoc + + +#endif + diff --git a/autodoc/source/exes/adc_uni/adc_cmds.cxx b/autodoc/source/exes/adc_uni/adc_cmds.cxx index bc500a771005..727c9fe89f34 100644 --- a/autodoc/source/exes/adc_uni/adc_cmds.cxx +++ b/autodoc/source/exes/adc_uni/adc_cmds.cxx @@ -2,9 +2,9 @@ * * $RCSfile: adc_cmds.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:31 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,10 +65,11 @@ // NOT FULLY DEFINED SERVICES -#include <cosv/template/tpltools.hxx> -#include <cosv/ploc.hxx> -#include "adc_cl.hxx" - +#include <ary/ary.hxx> +#include <autodoc/displaying.hxx> +#include <autodoc/dsp_html_std.hxx> +#include <display/corframe.hxx> +#include <display/uidldisp.hxx> namespace autodoc @@ -76,448 +77,44 @@ namespace autodoc namespace command { -Parse::InitMap Parse::aOptions_; - - - -inline bool -is( char * * pArgsIterator, const char * pOption ) -{ - return strcmp(*pArgsIterator, pOption) == 0; -} - -#define CHECK( cond, text ) \ - if ( NOT ( cond ) ) \ - throw X_CommandLine( text ) -#define CHECKOPT( cond, miss, opt ) \ - if ( NOT ( cond ) ) \ - { \ - StreamLock slMsg(100); \ - throw X_CommandLine( slMsg() << "Missing " << miss <<" after " << opt << "." << c_str ); \ - } - - -//************************** Parsing ***********************// - - -S_ProjectData::S_ProjectData( const char * i_sName, - const char * i_sRootDir ) - : sName(i_sName), - aRootDirectory(i_sRootDir,true), - // pLanguage, - bHtmlIsDefaultForDocs(false) - // aFiles -{ -} - -S_ProjectData::~S_ProjectData() -{ -} - -Parse::Parse( CommandLine & io_rCommandLine ) - : // sRepositoryName, - // sRepositoryDirectoryForUpdate - // pGlobal_Language - bGlobal_HtmlIsDefaultForDocs(false), - // aProjects, - pCommandLine(&io_rCommandLine) -{ -} - -Parse::~Parse() -{ - csv::erase_container_of_heap_ptrs(aProjects); -} - -S_ProjectData & -Parse::CreateDefaultProject() -{ - if ( aProjects.size() > 0 ) - throw new X_CommandLine("Unexpected default project in command line."); - - S_ProjectData * ret = new S_ProjectData("", "."); - aProjects.push_back(ret); - return *ret; -} - -char * * -Parse::do_Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - for ( char * * it = i_nCurArgsBegin; - it != i_nEndOfAllArgs; - ) - { - F_Init fi = FindFI(*it); - if (fi != 0) - it = (this->*fi)(it, i_nEndOfAllArgs); - } - - return it; -} - - -const Parse::InitMap & -Parse::Options() -{ - if ( aOptions_.size() > 0 ) - return aOptions_; - - // Workaround for MacOSX, gcc3 compiler bug with - // assigning temporaries of member function ptrs - // to const references of them: - F_Init fTemp = &Parse::FI_Start_ParseOptions; - aOptions_[udmstri(C_opt_Parse)] = fTemp; - - fTemp = &Parse::FI_SetName; - aOptions_[udmstri(C_opt_Name)] = fTemp; - - fTemp = &Parse::FI_SetUpdate; - aOptions_[udmstri(C_opt_Update)] = fTemp; - - fTemp = &Parse::FI_SetLanguage4All; - aOptions_[udmstri(C_opt_LangAll)] = fTemp; - - fTemp = &Parse::FI_SetExtensions4All; - aOptions_[udmstri(C_opt_ExtensionsAll)] = fTemp; - - fTemp = &Parse::FI_SetDocAttrs4All; - aOptions_[udmstri(C_opt_DocAll)] = fTemp; - - fTemp = &Parse::FI_Start_ProjectOptions; - aOptions_[udmstri(C_opt_Project)] = fTemp; - - fTemp = &Parse::FI_SetLanguage; - aOptions_[udmstri(C_opt_Lang)] = fTemp; - - fTemp = &Parse::FI_SetExtensions; - aOptions_[udmstri(C_opt_Extensions)] = fTemp; - - fTemp = &Parse::FI_SetDocAttrs; - aOptions_[udmstri(C_opt_Doc)] = fTemp; - - fTemp = &Parse::FI_SetSourceDirs; - aOptions_[udmstri(C_opt_SourceDir)] = fTemp; - - fTemp = &Parse::FI_SetSourceTrees; - aOptions_[udmstri(C_opt_SourceTree)] = fTemp; - - fTemp = &Parse::FI_SetSourceFiles; - aOptions_[udmstri(C_opt_SourceFile)] = fTemp; - - return aOptions_; -} - -Parse::F_Init -Parse::FindFI( const char * i_pArg ) const -{ - InitMap::const_iterator itFound = Options().find( udmstri(i_pArg) ); - if ( itFound == Options().end() ) - return 0; - - return (*itFound).second; -} - -char * * -Parse::FI_Start_ParseOptions( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - return i_nCurArgsBegin + 1; -} - -char * * -Parse::FI_SetName( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( **ret != '-' && ret != i_nEndOfAllArgs, - "name", C_opt_Name ); - - sRepositoryName = *ret; - return ++ret; -} - -char * * -Parse::FI_SetUpdate( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( **ret != '-' && ret != i_nEndOfAllArgs, - "directory", C_opt_Update ); - - sRepositoryDirectoryForUpdate = *ret; - pCommandLine->SetUpdate(*ret); - return ++ret; -} - -char * * -Parse::FI_SetLanguage4All( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - - if ( is(ret, C_arg_Cplusplus) ) - { - pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::cpp); - pGlobal_Language->aExtensions.push_back(udmstri("*.hxx")); - pGlobal_Language->aExtensions.push_back(udmstri("*.h")); - } - else if (is(ret, C_arg_Idl) ) - { - pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::idl); - pGlobal_Language->aExtensions.push_back(udmstri("*.idl")); - } - else if (is(ret, C_arg_Corba) ) - { - pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::corba); - pGlobal_Language->aExtensions.push_back(udmstri("*.idl")); - } - else if (is(ret, C_arg_Java) ) - { - pGlobal_Language = new S_LanguageInfo(S_LanguageInfo::java); - pGlobal_Language->aExtensions.push_back(udmstri("*.java")); - } - else - { - StreamLock slMsg(100); - throw X_CommandLine( - slMsg() << "Missing language after " << C_opt_LangAll << "." << c_str ); - } - - return ++ret; -} - -char * * -Parse::FI_SetExtensions4All( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret == '.', - "extension(s)", C_opt_ExtensionsAll ); - StreamLock slCheck(150); - slCheck() << C_opt_ExtensionsAll - << " used without previous " - << C_opt_LangAll; - - CHECK( pGlobal_Language != 0, - slCheck().c_str() ); - - do { - pGlobal_Language->aExtensions.push_back(udmstri(*ret)); - ++ret; - } while ( ret != i_nEndOfAllArgs && **ret == '.' ); - - return ret; -} - -char * * -Parse::FI_SetDocAttrs4All( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "attribute", C_opt_DocAll ); +extern const String C_opt_Include("-I:"); - if ( is(ret, C_arg_Usehtml) ) - { - bGlobal_HtmlIsDefaultForDocs = true; - ++ret; - } - else - { - throw X_CommandLine( - StreamLock(100)() << "Unknown attribute after " - << C_opt_DocAll - << "." - << c_str ); - } - - return ret; -} - -char * * -Parse::FI_Start_ProjectOptions( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - if ( aProjects.size() == 1 ) - { - if ( aProjects[0]->sName.length() == 0 ) - throw X_CommandLine( "Both, named projects and a default project, cannot be used together." ); - } +extern const String C_opt_Verbose("-v"); - S_ProjectData * pProject = 0; +extern const String C_opt_Parse("-parse"); +extern const String C_opt_Name("-name"); +extern const String C_opt_LangAll("-lg"); +extern const String C_opt_ExtensionsAll("-extg"); +extern const String C_opt_DevmanFile("-dvgfile"); - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "name", C_opt_Project ); - ++ret; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "root directory", C_opt_Project ); - ++ret; +extern const String C_arg_Cplusplus("c++"); +extern const String C_arg_Idl("idl"); +extern const String C_arg_Java("java"); - pProject = new S_ProjectData( i_nCurArgsBegin[1], i_nCurArgsBegin[2] ); - pCommandLine->SetCurProject(*pProject); - aProjects.push_back(pProject); - - return ret; -} +extern const String C_opt_Project("-p"); +//extern const String C_opt_Lang; +//extern const String C_opt_Extensions; +extern const String C_opt_SourceDir("-d"); +extern const String C_opt_SourceTree("-t"); +extern const String C_opt_SourceFile("-f"); -char * * -Parse::FI_SetLanguage( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - - if ( is(ret, C_arg_Cplusplus) ) - pCommandLine->CurProject().pLanguage - = new S_LanguageInfo(S_LanguageInfo::cpp); - else if (is(ret, C_arg_Idl) ) - pCommandLine->CurProject().pLanguage - = new S_LanguageInfo(S_LanguageInfo::idl); - else if (is(ret, C_arg_Corba) ) - pCommandLine->CurProject().pLanguage - = new S_LanguageInfo(S_LanguageInfo::corba); - else if (is(ret, C_arg_Java) ) - pCommandLine->CurProject().pLanguage - = new S_LanguageInfo(S_LanguageInfo::java); - else - throw X_CommandLine( - StreamLock(100)() << "Missing language after " - << C_opt_Lang - << "." - << c_str ); - - return ++ret; -} +extern const String C_opt_CreateHtml("-html"); +extern const String C_opt_DevmanRoot("-dvgroot"); +extern const String C_opt_SimpleLinks("-simplelinks"); -char * * -Parse::FI_SetExtensions( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - - CHECKOPT( ret != i_nEndOfAllArgs && **ret == '.', - "extension(s)", C_opt_Extensions ); - CHECK( pCommandLine->CurProject().pLanguage != 0, - StreamLock(100)() << C_opt_Extensions - << " used without previous " - << C_opt_Lang - << c_str ); - - do { - pCommandLine->CurProject().pLanguage - ->aExtensions.push_back(udmstri(*ret)); - ++ret; - } while ( ret != i_nEndOfAllArgs && **ret == '.' ); - - return ret; -} +//extern const String C_opt_CreateXml("-xml"); +//extern const String C_opt_Load("-load"); +//extern const String C_opt_Save("-save"); -char * * -Parse::FI_SetDocAttrs( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "attribute", C_opt_Doc ); - - if ( is(ret, C_arg_Usehtml) ) - { - pCommandLine->CurProject().bHtmlIsDefaultForDocs = true; - ++ret; - } - else - { - throw X_CommandLine( - StreamLock(100)() << "Unknown attribute after " - << C_opt_Doc - << "." - << c_str ); - } - - return ret; -} - -char * * -Parse::FI_SetSourceDirs( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "directory", C_opt_SourceDir ); - do { - pCommandLine->CurProject().aFiles. - aDirectories.push_back( udmstri(*ret) ); - ++ret; - } while (ret != i_nEndOfAllArgs && **ret != '-'); - - return ret; -} - -char * * -Parse::FI_SetSourceTrees( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "directory", C_opt_SourceTree ); - do { - pCommandLine->CurProject().aFiles. - aTrees.push_back( udmstri(*ret) ); - ++ret; - } while (ret != i_nEndOfAllArgs && **ret != '-'); - - return ret; -} - -char * * -Parse::FI_SetSourceFiles( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "file", C_opt_SourceFile ); // KORR_FUTURE - // What about files, which start with '-'? - do { - pCommandLine->CurProject().aFiles. - aFiles.push_back( udmstri(*ret) ); - ++ret; - } while (ret != i_nEndOfAllArgs && **ret != '-'); // KORR_FUTURE - // What about files, which start with '-'? - return ret; -} - -//************************** Load ***********************// - -Load::Load( const char * i_sRepositoryDirectory ) - : sRepositoryDirectory(i_sRepositoryDirectory) -{ -} - -Load::~Load() -{ -} - -char * * -Load::do_Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs AND **ret != '-', - "directory", C_opt_Load ); - - sRepositoryDirectory = *ret; - return ++ret; -} //************************** CreateHTML ***********************// CreateHtml::CreateHtml() -// : // sOutputRootDirectory, - // aExtLinks + : sOutputRootDirectory(), + sDevelopersManual_HtmlRoot(), + bSimpleLinks(false) { } @@ -525,81 +122,96 @@ CreateHtml::~CreateHtml() { } -char * * -CreateHtml::do_Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) +void +CreateHtml::do_Init( opt_iter & it, + opt_iter itEnd ) { - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', + ++it; + CHECKOPT( it != itEnd && (*it).char_at(0) != '-', "output directory", C_opt_CreateHtml ); - sOutputRootDirectory = *ret; + sOutputRootDirectory = *it; - if ( is(++ret, C_opt_ExternLinks) ) + for ( ++it; + it != itEnd AND (*it == C_opt_DevmanRoot OR *it == C_opt_SimpleLinks); + ++it ) { - CHECKOPT( ret+1 != i_nEndOfAllArgs && **(ret+1) != '-', - "namespace", C_opt_ExternLinks ); - CHECKOPT( ret+2 != i_nEndOfAllArgs && **(ret+2) != '-', - "linked root directory", C_opt_ExternLinks ); - do { - aExtLinks.push_back( S_ExternLinkage(*(ret+1), *(ret+2)) ); - ret += 3; - } while ( is(ret, C_opt_ExternLinks) ); - } - - return ret; + if (*it == C_opt_DevmanRoot) + { + ++it; + CHECKOPT( it != itEnd AND (*it).char_at(0) != '-', + "HTML root directory of Developers Guide", + C_opt_DevmanRoot ); + sDevelopersManual_HtmlRoot = *it; + } + else if (*it == C_opt_SimpleLinks) + { + bSimpleLinks = true; + } + } // end for } - -//************************** Out XML ***********************// - -CreateXml::CreateXml() -// : // sOutputRootDirectory +bool +CreateHtml::do_Run() const { + if ( ::ary::n22::Repository::The_().HasIdl() ) + run_Idl(); + if ( ::ary::n22::Repository::The_().HasCpp() ) + run_Cpp(); + return true; } -CreateXml::~CreateXml() +int +CreateHtml::inq_RunningRank() const { + return static_cast<int>(rank_CreateHtml); } -char * * -CreateXml::do_Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) +void +CreateHtml::run_Idl() const { - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs && **ret != '-', - "output directory", C_opt_CreateXml ); + const ary::idl::Gate & + rGate = ary::n22::Repository::The_().Gate_Idl(); - sOutputRootDirectory = *ret; - return ++ret; -} + Cout() << "Creating HTML-output into the directory " + << sOutputRootDirectory + << "." + << Endl(); + const DisplayToolsFactory_Ifc & + rToolsFactory = DisplayToolsFactory_Ifc::GetIt_(); + Dyn<autodoc::HtmlDisplay_Idl_Ifc> + pDisplay( rToolsFactory.Create_HtmlDisplay_Idl() ); -//************************** Save ***********************// + DYN display::CorporateFrame & // KORR: Remove the need for const_cast in future. + drFrame = const_cast< display::CorporateFrame& >(rToolsFactory.Create_StdFrame()); + if (NOT DevelopersManual_HtmlRoot().empty()) + drFrame.Set_DevelopersGuideHtmlRoot( DevelopersManual_HtmlRoot() ); + if (bSimpleLinks) + drFrame.Set_SimpleLinks(); -Save::Save() -// : // sRepositoryDirectory, -{ + pDisplay->Run( sOutputRootDirectory, + rGate, + drFrame ); } -Save::~Save() +void +CreateHtml::run_Cpp() const { -} + const ary::n22::Repository & + rReposy = ary::n22::Repository::The_(); + const ary::cpp::DisplayGate & + rGate = rReposy.Gate_Cpp(); -char * * -Save::do_Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) -{ - char * * ret = i_nCurArgsBegin + 1; - CHECKOPT( ret != i_nEndOfAllArgs AND **ret != '-', - "directory", C_opt_Save ); + const DisplayToolsFactory_Ifc & + rToolsFactory = DisplayToolsFactory_Ifc::GetIt_(); + Dyn< autodoc::HtmlDisplay_UdkStd > + pDisplay( rToolsFactory.Create_HtmlDisplay_UdkStd() ); - sRepositoryDirectory = *ret; - return ++ret; + pDisplay->Run( sOutputRootDirectory, + rGate, + rToolsFactory.Create_StdFrame() ); } } // namespace command } // namespace autodoc - - - diff --git a/autodoc/source/exes/adc_uni/adc_cmds.hxx b/autodoc/source/exes/adc_uni/adc_cmds.hxx index 210602ffeffd..4c2d31900ee0 100644 --- a/autodoc/source/exes/adc_uni/adc_cmds.hxx +++ b/autodoc/source/exes/adc_uni/adc_cmds.hxx @@ -2,9 +2,9 @@ * * $RCSfile: adc_cmds.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -66,365 +66,161 @@ // USED SERVICES // BASE CLASSES -#include <cosv/comdline.hxx> +#include "adc_cmd.hxx" // COMPONENTS -#include <cosv/ploc.hxx> // PARAMETERS -namespace ary -{ - class Repository; -} - namespace autodoc { - class CommandLine; - namespace command { -class Command -{ - public: - virtual ~Command() {} - - /** @return The first not parsed argument. - If an error occured, 0 is returned. - */ - char * * Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - private: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) = 0; -}; - -inline char * * -Command::Init( char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ) - { return do_Init(i_nCurArgsBegin, i_nEndOfAllArgs); } - - -struct S_ProjectData; -struct S_LanguageInfo; -struct S_ExternLinkage; - -class Parse : public Command -{ - public: - typedef std::vector< DYN S_ProjectData * > ProjectList; - typedef ProjectList::const_iterator ProjectIterator; - - Parse( - CommandLine & io_rCommandLine ); - ~Parse(); - - // INQUIRY - const udmstri & ReposyName() const; - const S_LanguageInfo * - GlobalLanguageInfo() const; - bool GlobalIsHtmlDefaultForDocs() const; - ProjectIterator ProjectsBegin() const; - ProjectIterator ProjectsEnd() const; - - - // ACCESS - S_ProjectData & CreateDefaultProject(); - - private: - // Interface Command: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - - typedef char * * (Parse::*F_Init)(char * *, char * *); - typedef std::map< udmstri , F_Init > InitMap; - - static const InitMap & - Options(); - F_Init FindFI( - const char * i_pArg ) const; - - char * * FI_Start_ParseOptions( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetName( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetUpdate( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetLanguage4All( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetExtensions4All( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetDocAttrs4All( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - - char * * FI_Start_ProjectOptions( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetLanguage( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetExtensions( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetDocAttrs( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetSourceDirs( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetSourceTrees( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - char * * FI_SetSourceFiles( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - - // DATA - udmstri sRepositoryName; - udmstri sRepositoryDirectoryForUpdate; - - Dyn<S_LanguageInfo> pGlobal_Language; - bool bGlobal_HtmlIsDefaultForDocs; - - ProjectList aProjects; - - CommandLine * pCommandLine; - static InitMap aOptions_; -}; - -inline const udmstri & -Parse::ReposyName() const - { return sRepositoryName; } -inline const S_LanguageInfo * -Parse::GlobalLanguageInfo() const - { return pGlobal_Language ? pGlobal_Language.Ptr() : 0; } -inline bool -Parse::GlobalIsHtmlDefaultForDocs() const - { return bGlobal_HtmlIsDefaultForDocs; } -inline Parse::ProjectIterator -Parse::ProjectsBegin() const - { return aProjects.begin(); } -inline Parse::ProjectIterator -Parse::ProjectsEnd() const - { return aProjects.end(); } - -class Load : public Command -{ - public: - Load( - const char * i_sRepositoryDirectory = "" ); - ~Load(); - - const udmstri & ReposyDir() const; - - private: - // Interface Command: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - // DATA - udmstri sRepositoryDirectory; -}; - -inline const udmstri & -Load::ReposyDir() const - { return sRepositoryDirectory; } - -struct S_ExternLinkage -{ - S_ExternLinkage( - const char * i_sNamespace, - const char * i_sLinkedRootDirectory ) - : sNamespace(i_sNamespace), - sLinkedRootDirectory(i_sLinkedRootDirectory) - { } - - udmstri sNamespace; - udmstri sLinkedRootDirectory; - -}; - +/** A command that produces HTML output from the Autodoc Repository. +*/ class CreateHtml : public Command { public: CreateHtml(); ~CreateHtml(); - const udmstri & OutputDir() const; + const String & OutputDir() const; + const String & DevelopersManual_HtmlRoot() const + { return sDevelopersManual_HtmlRoot; } private: + // Interface Context: + virtual void do_Init( + opt_iter & i_nCurArgsBegin, + opt_iter i_nEndOfAllArgs ); // Interface Command: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - // DATA - udmstri sOutputRootDirectory; - - std::vector< S_ExternLinkage > - aExtLinks; -}; - -inline const udmstri & -CreateHtml::OutputDir() const - { return sOutputRootDirectory; } + virtual bool do_Run() const; + virtual int inq_RunningRank() const; + // Locals + void run_Cpp() const; + void run_Idl() const; -class CreateXml : public Command -{ - public: - CreateXml(); - ~CreateXml(); - - const udmstri & OutputDir() const; - - private: - // Interface Command: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); // DATA - udmstri sOutputRootDirectory; + String sOutputRootDirectory; + String sDevelopersManual_HtmlRoot; + bool bSimpleLinks; }; -inline const udmstri & -CreateXml::OutputDir() const +inline const String & +CreateHtml::OutputDir() const { return sOutputRootDirectory; } - -class Save : public Command +#if 0 // KORR_FUTUREs +//class CreateXml : public Command +//{ +// public: +// CreateXml(); +// ~CreateXml(); +// +// const String & OutputDir() const; +// +// private: +// // Interface Command: +// virtual char * * do_Init( +// opt_iter & i_nCurArgsBegin, +// opt_iter i_nEndOfAllArgs ); +// // DATA +// String sOutputRootDirectory; +//}; +// +//inline const String & +//CreateXml::OutputDir() const +// { return sOutputRootDirectory; } +// +//class Load : public Command +//{ +// public: +// Load( +// const char * i_sRepositoryDirectory = "" ); +// ~Load(); +// +// const String & ReposyDir() const; +// +// private: +// // Interface Command: +// virtual char * * do_Init( +// opt_iter & i_nCurArgsBegin, +// opt_iter i_nEndOfAllArgs ); +// virtual void do_Run() const; +// +// // DATA +// String sRepositoryDirectory; +//}; +// +//inline const String & +//Load::ReposyDir() const +// { return sRepositoryDirectory; } +// +//class Save : public Command +//{ +// public: +// Save(); +// ~Save(); +// +// const String & ReposyDir() const; +// +// private: +// // Interface Command: +// virtual char * * do_Init( +// opt_iter & i_nCurArgsBegin, +// opt_iter i_nEndOfAllArgs ); +// // DATA +// String sRepositoryDirectory; +//}; +// +//inline const String & +//Save::ReposyDir() const +// { return sRepositoryDirectory; } +#endif 0 // KORR_FUTURE + + + + +extern const String C_opt_Verbose; + +extern const String C_opt_Parse; +extern const String C_opt_Name; +extern const String C_opt_LangAll; +extern const String C_opt_ExtensionsAll; +extern const String C_opt_DevmanFile; + +extern const String C_arg_Cplusplus; +extern const String C_arg_Idl; +extern const String C_arg_Java; + +extern const String C_opt_Project; +//extern const String C_opt_Lang; +//extern const String C_opt_Extensions; +extern const String C_opt_SourceTree; +extern const String C_opt_SourceDir; +extern const String C_opt_SourceFile; + +extern const String C_opt_CreateHtml; +extern const String C_opt_DevmanRoot; +extern const String C_opt_SimpleLinks; + +//extern const String C_opt_CreateXml; +//extern const String C_opt_Load; +//extern const String C_opt_Save; + + +inline void +CHECKOPT( bool b, const char * miss, const String & opt ) { - public: - Save(); - ~Save(); - - const udmstri & ReposyDir() const; - - private: - // Interface Command: - virtual char * * do_Init( - char * * i_nCurArgsBegin, - char * * i_nEndOfAllArgs ); - // DATA - udmstri sRepositoryDirectory; -}; - -inline const udmstri & -Save::ReposyDir() const - { return sRepositoryDirectory; } - - -class X_CommandLine -{ - public: - X_CommandLine( - const char * i_sExplanation ) - : sExplanation(i_sExplanation) {} - - void Report( - ostream & o_rOut ) - { o_rOut << "Error in command line: " - << sExplanation << Endl(); } - - private: - udmstri sExplanation; -}; - -struct S_LanguageInfo -{ - enum E_ProgrammingLanguage + if ( NOT b ) { - none, - cpp, - idl, - corba, - java - }; - S_LanguageInfo( - E_ProgrammingLanguage - i_eLang ); - StringVector - aExtensions; // An empty string is possible and means exactly that: files without extension. - E_ProgrammingLanguage - eLanguage; -}; - -inline -S_LanguageInfo::S_LanguageInfo( E_ProgrammingLanguage i_eLang ) -{ - eLanguage = i_eLang; + StreamLock slMsg(100); + throw X_CommandLine( slMsg() << "Missing " << miss <<" after " << opt << "." << c_str ); + } } -struct S_Sources -{ - StringVector aDirectories; - StringVector aTrees; - StringVector aFiles; -}; - -struct S_ProjectData -{ - S_ProjectData( - const char * i_sName, - const char * i_sRootDir ); - ~S_ProjectData(); - - udmstri sName; - csv::ploc::Path aRootDirectory; - - Dyn<S_LanguageInfo> pLanguage; - bool bHtmlIsDefaultForDocs; - - S_Sources aFiles; -}; - - - - -const char * const C_opt_Verbose = "-v"; - -const char * const C_opt_Parse = "-parse"; -const char * const C_opt_Name = "-name"; -const char * const C_opt_Update = "-update"; -const char * const C_opt_LangAll = "-lg"; -const char * const C_opt_ExtensionsAll = "-extg"; -const char * const C_opt_DocAll = "-docg"; - -const char * const C_arg_Usehtml = "usehtml"; -const char * const C_arg_Cplusplus = "c++"; -const char * const C_arg_Idl = "idl"; -const char * const C_arg_Corba = "corba"; -const char * const C_arg_Java = "java"; - -const char * const C_opt_Project = "-p"; -const char * const C_opt_Lang = "-l"; -const char * const C_opt_Extensions = "-ext"; -const char * const C_opt_Doc = "-doc"; -const char * const C_opt_SourceDir = "-d"; -const char * const C_opt_SourceTree = "-t"; -const char * const C_opt_SourceFile = "-f"; - -const char * const C_opt_Load = "-load"; - -const char * const C_opt_CreateHtml = "-html"; -const char * const C_opt_ExternLinks = "-xlinks"; - -const char * const C_opt_CreateXml = "-xml"; -const char * const C_opt_Save = "-save"; - -// IMPLEMENTATION - - - } // namespace command } // namespace autodoc diff --git a/autodoc/source/exes/adc_uni/cmd_run.cxx b/autodoc/source/exes/adc_uni/cmd_run.cxx index 014c8a008276..75f0ee96ec2a 100644 --- a/autodoc/source/exes/adc_uni/cmd_run.cxx +++ b/autodoc/source/exes/adc_uni/cmd_run.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cmd_run.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:31 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,18 +75,18 @@ #include <ary/idl/i_module.hxx> #include <ary/idl/ip_ce.hxx> #include <ary/idl/ip_2s.hxx> -#include <autodoc/displaying.hxx> -#include <autodoc/dsp_html_std.hxx> #include <autodoc/filecoli.hxx> #include <autodoc/parsing.hxx> #include <autodoc/prs_code.hxx> #include <autodoc/prs_docu.hxx> -#include <display/uidldisp.hxx> #include <parser/unoidl.hxx> #include "adc_cl.hxx" +#include "adc_cmd_parse.hxx" #include "adc_cmds.hxx" +namespace +{ ary::idl::Gate * G_pGate = 0; ary::idl::Gate & @@ -95,23 +95,235 @@ GetAryGate() csv_assert(G_pGate != 0); return *G_pGate; } +} // anonymous namespace -#if 0 -namespace + +namespace autodoc +{ +namespace command +{ +namespace run { -void Recursive_PutOutNamespace( - csi::uidl::Display & o_rDisplay, - const ary::idl::Module & i_rNamespace, - const ary::idl::Gate & i_rGate ); +Parser::Parser( const Parse & i_command ) + : rCommand(i_command), + pCppParser(), + pCppDocuInterpreter(), + pIdlParser() +{ +} -} // anonymous namespace -#endif // 0 +Parser::~Parser() +{ +} -namespace autodoc +bool +Parser::Perform() +{ + Cout() << "Parsing the repository " + << rCommand.ReposyName() + << " ..." + << Endl(); + try + { + ::ary::n22::Repository & + rAry = ::ary::n22::Repository::The_(); + rAry.Set_Name(rCommand.ReposyName()); + + Dyn< FileCollector_Ifc > + pFiles( ParseToolsFactory().Create_FileCollector(6000) ); + + bool bIDL = false; + bool bCpp = false; + + command::Parse::ProjectIterator + itEnd = rCommand.ProjectsEnd(); + for ( command::Parse::ProjectIterator it = rCommand.ProjectsBegin(); + it != itEnd; + ++it ) + { + uintt nCount = GatherFiles( *pFiles, *(*it) ); + Cout() << nCount + << " files found to parse in project " + << (*it)->Name() + << "." + << Endl(); + + switch ( (*it)->Language().eLanguage ) + { + case command::S_LanguageInfo::idl: + { + Get_IdlParser().Run(*pFiles); + bIDL = true; + } break; + case command::S_LanguageInfo::cpp: + { + Get_CppParser().Run( (*it)->Name(), + (*it)->RootDirectory(), + *pFiles ); + bCpp = true; + } break; + default: + Cerr() << "Project in yet unimplemented language skipped." + << Endl(); + } + } // end for + + if (bCpp) + { + rAry.Gate_Cpp().Connect_AllTypes_2_TheirRelated_CodeEntites(); + } + if (bIDL) + { + ::ary::idl::SecondariesPilot & + rIdl2sPilot = rAry.Gate_Idl().Secondaries(); + + rIdl2sPilot.Connect_Types2Ces(); + rIdl2sPilot.Gather_CrossReferences(); + + if (NOT rCommand.DevelopersManual_RefFilePath().empty()) + { + csv::File + aFile(rCommand.DevelopersManual_RefFilePath(), csv::CFM_READ); + if ( aFile.open() ) + { + rIdl2sPilot.Read_Links2DevManual(aFile); + aFile.close(); + } + } + } // endif (bIDL) + + return true; + + } // end try + catch (csv::Exception & xx) + { + xx.GetInfo(Cerr()); + Cerr() << " program will exit." << Endl(); + + return false; + } +} + +CodeParser_Ifc & +Parser::Get_CppParser() +{ + if ( NOT pCppParser ) + Create_CppParser(); + return *pCppParser; +} + +IdlParser & +Parser::Get_IdlParser() +{ + if ( NOT pIdlParser ) + Create_IdlParser(); + return *pIdlParser; +} + +void +Parser::Create_CppParser() +{ + pCppParser = ParseToolsFactory().Create_Parser_Cplusplus(); + pCppDocuInterpreter = ParseToolsFactory().Create_DocuParser_AutodocStyle(); + + pCppParser->Setup( ary::Repository::The_(), + *pCppDocuInterpreter ); +} + +void +Parser::Create_IdlParser() +{ + pIdlParser = new IdlParser(ary::n22::Repository::The_()); +} + +const ParseToolsFactory_Ifc & +Parser::ParseToolsFactory() +{ + return ParseToolsFactory_Ifc::GetIt_(); +} + +uintt +Parser::GatherFiles( FileCollector_Ifc & o_rFiles, + const S_ProjectData & i_rProject ) { + uintt ret = 0; + o_rFiles.EraseAll(); + + typedef StringVector StrVector; + typedef StrVector::const_iterator StrIterator; + const S_Sources & + rSources = i_rProject.Sources(); + const StrVector & + rExtensions = i_rProject.Language().aExtensions; + + StrIterator it; + StrIterator itTreesEnd = rSources.aTrees.end(); + StrIterator itDirsEnd = rSources.aDirectories.end(); + StrIterator itFilesEnd = rSources.aFiles.end(); + StrIterator itExt; + StrIterator itExtEnd = rExtensions.end(); + + csv::StreamStr aDir(500); + i_rProject.RootDirectory().Get( aDir ); + + uintt nProjectDir_AddPosition = + ( strcmp(aDir.c_str(),".\\") == 0 OR strcmp(aDir.c_str(),"./") == 0 ) + ? 0 + : uintt( aDir.tellp() ); + + for ( it = rSources.aDirectories.begin(); + it != itDirsEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + for ( itExt = rExtensions.begin(); + itExt != itExtEnd; + ++itExt ) + { + ret += o_rFiles.AddFilesFrom( aDir.c_str(), + *itExt, + FileCollector_Ifc::flat ); + } // end for itExt + } // end for it + for ( it = rSources.aTrees.begin(); + it != itTreesEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + for ( itExt = rExtensions.begin(); + itExt != itExtEnd; + ++itExt ) + { + ret += o_rFiles.AddFilesFrom( aDir.c_str(), + *itExt, + FileCollector_Ifc::recursive ); + } // end for itExt + } // end for it + for ( it = rSources.aFiles.begin(); + it != itFilesEnd; + ++it ) + { + aDir.seekp( nProjectDir_AddPosition ); + aDir << *it; + + o_rFiles.AddFile( aDir.c_str() ); + } // end for it + ret += rSources.aFiles.size(); + + return ret; +} +} // namespace run +} // namespace command + + +#if 0 inline const ParseToolsFactory_Ifc & CommandRunner::ParseToolsFactory() { return ParseToolsFactory_Ifc::GetIt_(); } @@ -143,7 +355,7 @@ CommandRunner::CommandRunner() pNewReposy(0), nResultCode(0) { - Cout() << "\nAutodoc version 2.2" + Cout() << "\nAutodoc version 2.2.1" << "\n-------------------" << "\n" << Endl(); } @@ -154,30 +366,17 @@ CommandRunner::~CommandRunner() Cout() << "\n" << Endl(); } -int +void CommandRunner::Run( const CommandLine & i_rCL ) { ary::Repository::Destroy_(); +// ary::n22::Repository::Destroy_(); pReposy = 0; + pNewReposy = 0; nResultCode = 0; pCommandLine = &i_rCL; - if ( nResultCode == 0 AND pCommandLine->Cmd_Load() ) - Load(); - - if ( nResultCode == 0 AND pCommandLine->Cmd_Parse() ) - Parse(); - - if ( nResultCode == 0 AND pCommandLine->Cmd_Save() ) - Save(); - - if ( nResultCode == 0 AND pCommandLine->Cmd_CreateHtml() ) - CreateHtml(); - - if ( nResultCode == 0 AND pCommandLine->Cmd_CreateXml() ) - CreateXml(); - - return nResultCode; + pCommandLine->Run(); } void @@ -215,7 +414,7 @@ CommandRunner::Parse() uintt nCount = GatherFiles( *pFiles, rCmd, *(*it) ); Cout() << nCount << " files found to parse in project " - << (*it)->sName + << (*it)->Name() << "." << Endl(); @@ -224,8 +423,8 @@ CommandRunner::Parse() { case command::S_LanguageInfo::cpp: { - Get_CppParser().Run( (*it)->sName, - (*it)->aRootDirectory, + Get_CppParser().Run( (*it)->Name(), + (*it)->RootDirectory(), *pFiles ); bCpp = true; } break; @@ -437,7 +636,7 @@ CommandRunner::CreateHtml_OldIdlStyle() rAryGate = pNewReposy->Gate_Idl(); // Read DevManualLinkFile: - // KORR + // KORR_FUTURE csv::File aFile("devmanref.txt", csv::CFM_READ); if ( aFile.open() ) @@ -454,64 +653,10 @@ CommandRunner::CreateHtml_OldIdlStyle() rAryGate, DisplayToolsFactory_Ifc::GetIt_().Create_StdFrame() ); } - +#endif // 0 } // namespace autodoc -#if 0 -namespace -{ - -typedef std::vector< ary::idl::Module * > LocalSNList; - -inline void -DisplayCe( csi::uidl::Display & o_rDisplay, - ary::idl::Ce_id i_nID, - const ary::idl::Gate & i_rGate ) -{ - const ary::idl::CodeEntity & rEntity = i_rGate.Ces().Find_Ce(i_nID); - rEntity.Visit(o_rDisplay); -} - -void -Recursive_PutOutNamespace( csi::uidl::Display & o_rDisplay, - const ary::idl::Module & i_rNamespace, - const ary::idl::Gate & i_rGate ) -{ - static StreamStr sPath(512); - sPath.seekp(0); - i_rNamespace.GetFullName( sPath, csv::ploc::Delimiter() ); - o_rDisplay.InitModule( i_rNamespace.Name(), - sPath.c_str(), - i_rNamespace.Depth() ); - - DisplayCe(o_rDisplay, i_rNamespace.Id(), i_rGate); - - const ary::idl::Module::NameMap & rMap = i_rNamespace.LocalNames(); - - for ( ary::idl::Module::NameMap::const_iterator iter = rMap.begin(); - iter != rMap.end(); - ++iter ) - { - if ( uintt((*iter).second.second) > uintt(ary::uidl::CeNamespace::nok_predeclaration) ) - DisplayCe(o_rDisplay, (*iter).second.first, i_rGate); - } // for - - LocalSNList aSubNamespaces; - i_rNamespace.GetSubNamespaces(aSubNamespaces); - - for ( LocalSNList::iterator iter2 = aSubNamespaces.begin(); - iter2 != aSubNamespaces.end(); - ++iter2 ) - { - csv_assert(*iter2 != 0); - Recursive_PutOutNamespace(o_rDisplay, *(*iter2), i_rGate); - } // for -} - -} // anonymous namespace - -#endif // 0 diff --git a/autodoc/source/exes/adc_uni/cmd_run.hxx b/autodoc/source/exes/adc_uni/cmd_run.hxx index 2a2ae519bb11..88ee9b468a33 100644 --- a/autodoc/source/exes/adc_uni/cmd_run.hxx +++ b/autodoc/source/exes/adc_uni/cmd_run.hxx @@ -2,9 +2,9 @@ * * $RCSfile: cmd_run.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:31 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -82,74 +82,47 @@ namespace ary namespace autodoc { - class Uidl_Parser; -} - -namespace autodoc -{ - namespace command - { - class Parse; - struct S_ProjectData; - struct S_LanguageInfo; - } - - class CommandLine; class FileCollector_Ifc; class ParseToolsFactory_Ifc; class CodeParser_Ifc; class DocumentationParser_Ifc; - typedef autodoc::Uidl_Parser IdlParser; + class IdlParser; -class CommandRunner +namespace command +{ + class Parse; + class S_ProjectData; + struct S_LanguageInfo; + +namespace run +{ + +/** Performs an ::autodoc::command::Parse . +*/ +class Parser { public: - CommandRunner(); - ~CommandRunner(); + Parser( + const Parse & i_command ); + ~Parser(); + bool Perform(); - int Run( - const CommandLine & i_rCL ); private: // Locals - void Parse(); - void Load(); - void Save(); - void CreateHtml(); - void CreateXml(); - CodeParser_Ifc & Get_CppParser(); IdlParser & Get_IdlParser(); void Create_CppParser(); void Create_IdlParser(); - - inline const ParseToolsFactory_Ifc & + const ParseToolsFactory_Ifc & ParseToolsFactory(); - inline const command::S_LanguageInfo & - Get_ProjectLanguage( - const command::Parse & - i_rCommand, - const command::S_ProjectData & - i_rProject ); uintt GatherFiles( FileCollector_Ifc & o_rFiles, - const command::Parse & - i_rCommand, - const command::S_ProjectData & + const S_ProjectData & i_rProject ); - void CreateHtml_NewStyle(); - void CreateHtml_OldIdlStyle(); - - bool HasParsedCpp() const; - bool HasParsedIdl() const; - // DATA - const CommandLine * pCommandLine; - ary::Repository * pReposy; - ary::n22::Repository * - pNewReposy; - int nResultCode; + const Parse & rCommand; Dyn<CodeParser_Ifc> pCppParser; Dyn<DocumentationParser_Ifc> @@ -159,9 +132,12 @@ class CommandRunner + // IMPLEMENTATION +} // namespace run +} // namespace command } // namespace autodoc #endif diff --git a/autodoc/source/exes/adc_uni/main.cxx b/autodoc/source/exes/adc_uni/main.cxx index 06d96d8f0e18..32e8f4375ce7 100644 --- a/autodoc/source/exes/adc_uni/main.cxx +++ b/autodoc/source/exes/adc_uni/main.cxx @@ -2,9 +2,9 @@ * * $RCSfile: main.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-05-14 09:02:17 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,14 +75,12 @@ int main( int argc, char * argv[] ) { - autodoc::CommandLine aCL; - autodoc::CommandRunner aRunner; - + autodoc::CommandLine aCL; aCL.Init(argc, argv); if (NOT aCL.CheckParameters() ) return 1; - int ret = aRunner.Run(aCL); + int ret = aCL.Run(); return ret; } diff --git a/autodoc/source/exes/adc_uni/makefile.mk b/autodoc/source/exes/adc_uni/makefile.mk index f7e20e7186b5..82524c3c309f 100644 --- a/autodoc/source/exes/adc_uni/makefile.mk +++ b/autodoc/source/exes/adc_uni/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.5 $ +# $Revision: 1.6 $ # -# last change: $Author: np $ $Date: 2002-11-01 17:15:32 $ +# last change: $Author: np $ $Date: 2002-11-14 18:02:02 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -80,6 +80,7 @@ PRJINC=$(PRJ)$/source OBJFILES= \ $(OBJ)$/adc_cl.obj \ + $(OBJ)$/adc_cmd_parse.obj \ $(OBJ)$/adc_cmds.obj \ $(OBJ)$/cmd_run.obj diff --git a/autodoc/source/inc/adc_cl.hxx b/autodoc/source/inc/adc_cl.hxx index bf187acf3842..d45ca401ac74 100644 --- a/autodoc/source/inc/adc_cl.hxx +++ b/autodoc/source/inc/adc_cl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: adc_cl.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:27 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,51 +72,30 @@ namespace autodoc { - namespace command - { - class Parse; - class Load; - class CreateHtml; - class CreateXml; - class Save; - - struct S_ProjectData; - } - +namespace command +{ + class Command; +} +/** Reads and runs an Autodoc command line. +*/ class CommandLine : public csv::CommandLine_Ifc { public: + // LIFECYCLE CommandLine(); ~CommandLine(); + // OPERATIONS + int Run() const; + // INQUIRY bool DebugStyle_ShowText() const; bool DebugStyle_ShowStoredObjects() const; bool DebugStyle_ShowTokens() const; // ACCESS - void SetUpdate( - const char * i_sRepositoryDir ); - void SetCurProject( - command::S_ProjectData & - io_rProject ); - command::S_ProjectData & - CurProject(); - static const CommandLine & Get_(); - - const Dyn<command::Parse> & - Cmd_Parse() const; - const Dyn<command::Load> & - Cmd_Load() const; - const Dyn<command::CreateHtml> & - Cmd_CreateHtml() const; - const Dyn<command::CreateXml> & - Cmd_CreateXml() const; - const Dyn<command::Save> & - Cmd_Save() const; - private: // Interface cosv::CommandLine_Ifc: virtual void do_Init( @@ -126,19 +105,39 @@ class CommandLine : public csv::CommandLine_Ifc virtual bool inq_CheckParameters() const; // Locals + typedef StringVector::const_iterator opt_iter; + typedef std::vector< DYN command::Command* > CommandList; + + void load_IncludedCommands( + StringVector & out, + const char * i_filePath ); + + void do_clVerbose( + opt_iter & it, + opt_iter itEnd ); + void do_clParse( + opt_iter & it, + opt_iter itEnd ); + void do_clCreateHtml( + opt_iter & it, + opt_iter itEnd ); + +// void do_clCreateXml( +// opt_iter & it, +// opt_iter itEnd ); +// void do_clLoad( +// opt_iter & it, +// opt_iter itEnd ); +// void do_clSave( +// opt_iter & it, +// opt_iter itEnd ); + + void sort_Commands(); // DATA uintt nDebugStyle; - Dyn<command::Parse> pCmd_Parse; - Dyn<command::Load> pCmd_Load; - Dyn<command::CreateHtml> - pCmd_CreateHtml; - Dyn<command::CreateXml> - pCmd_CreateXml; - Dyn<command::Save> pCmd_Save; - - command::S_ProjectData * - pCurProject; + + CommandList aCommands; bool bInitOk; static CommandLine * pTheInstance_; @@ -157,22 +156,6 @@ inline bool CommandLine::DebugStyle_ShowTokens() const { return (nDebugStyle & 1) != 0; } -inline const Dyn<command::Parse> & -CommandLine::Cmd_Parse() const - { return pCmd_Parse; } -inline const Dyn<command::Load> & -CommandLine::Cmd_Load() const - { return pCmd_Load; } -inline const Dyn<command::CreateHtml> & -CommandLine::Cmd_CreateHtml() const - { return pCmd_CreateHtml; } -inline const Dyn<command::CreateXml> & -CommandLine::Cmd_CreateXml() const - { return pCmd_CreateXml; } -inline const Dyn<command::Save> & -CommandLine::Cmd_Save() const - { return pCmd_Save; } - diff --git a/autodoc/source/parser/cpp/prs_cpp.cxx b/autodoc/source/parser/cpp/prs_cpp.cxx index 690dc1fa91da..76ec57c558af 100644 --- a/autodoc/source/parser/cpp/prs_cpp.cxx +++ b/autodoc/source/parser/cpp/prs_cpp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: prs_cpp.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:32 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:04 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -141,7 +141,7 @@ Cpluplus_Parser::Setup( ary::Repository & o_rRepository, void Cpluplus_Parser::Run( const udmstri & i_sProjectName, - csv::ploc::Path & i_rProjectRootDirectory, + const csv::ploc::Path & i_rProjectRootDirectory, const autodoc::FileCollector_Ifc & i_rFiles ) { pRunningData->aDealer.StartNewProject( i_sProjectName, i_rProjectRootDirectory ); diff --git a/autodoc/source/parser/inc/cpp/prs_cpp.hxx b/autodoc/source/parser/inc/cpp/prs_cpp.hxx index aab0aa91aa1a..0772580efb4b 100644 --- a/autodoc/source/parser/inc/cpp/prs_cpp.hxx +++ b/autodoc/source/parser/inc/cpp/prs_cpp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: prs_cpp.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:33 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,7 +89,8 @@ class Cpluplus_Parser : public autodoc::CodeParser_Ifc virtual void Run( const udmstri & i_sProjectName, - csv::ploc::Path & i_rProjectRootDirectory, + const csv::ploc::Path & + i_rProjectRootDirectory, const autodoc::FileCollector_Ifc & i_rFiles ); private: diff --git a/autodoc/source/parser_i/idl/parsenv2.cxx b/autodoc/source/parser_i/idl/parsenv2.cxx index 4657b57a7f72..0731deca78dc 100644 --- a/autodoc/source/parser_i/idl/parsenv2.cxx +++ b/autodoc/source/parser_i/idl/parsenv2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: parsenv2.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:36 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,7 +142,6 @@ UnoIDL_PE::SetOptional() { if (NOT pDocu) { - Cout() << "OPTIONAL without documentation found (no dysfunction, just info)." << Endl(); pDocu = new ary::info::CodeInformation; } diff --git a/autodoc/source/parser_i/idl/unoidl.cxx b/autodoc/source/parser_i/idl/unoidl.cxx index 0b745247b687..5c86d93a3034 100644 --- a/autodoc/source/parser_i/idl/unoidl.cxx +++ b/autodoc/source/parser_i/idl/unoidl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: unoidl.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: np $ $Date: 2002-11-01 17:15:42 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,13 +107,13 @@ class FileParsePerformers }; -Uidl_Parser::Uidl_Parser( ary::n22::Repository & io_rRepository ) +IdlParser::IdlParser( ary::n22::Repository & io_rRepository ) : pRepository(&io_rRepository) { } void -Uidl_Parser::Run( const autodoc::FileCollector_Ifc & i_rFiles ) +IdlParser::Run( const autodoc::FileCollector_Ifc & i_rFiles ) { Dyn<FileParsePerformers> pFileParsePerformers( new FileParsePerformers(*pRepository) ); diff --git a/autodoc/source/tools/filecoll.cxx b/autodoc/source/tools/filecoll.cxx index 00d1912c4f5b..807bc5d6b030 100644 --- a/autodoc/source/tools/filecoll.cxx +++ b/autodoc/source/tools/filecoll.cxx @@ -2,9 +2,9 @@ * * $RCSfile: filecoll.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: np $ $Date: 2002-05-14 09:02:21 $ + * last change: $Author: np $ $Date: 2002-11-14 18:02:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -161,8 +161,3 @@ FileCollector::Size() const return aFoundFiles.size(); } - - - - - |