diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 11:08:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-24 16:53:56 +0000 |
commit | 17ecf0036d44657b954de6c8f7efd536ab5c4809 (patch) | |
tree | 313962191e32e2ab611e3e25b8237b6ad76a329b /xml2cmp | |
parent | 45350532879f8b33741fa1ac012aa43a776ebdf5 (diff) |
callcatcher: update list, remove newly unused methods
Diffstat (limited to 'xml2cmp')
-rw-r--r-- | xml2cmp/Executable_xml2cmp.mk | 1 | ||||
-rw-r--r-- | xml2cmp/source/xcd/cr_index.cxx | 276 | ||||
-rw-r--r-- | xml2cmp/source/xcd/cr_index.hxx | 92 | ||||
-rw-r--r-- | xml2cmp/source/xcd/main.cxx | 3 | ||||
-rw-r--r-- | xml2cmp/source/xcd/xmlelem.cxx | 6 | ||||
-rw-r--r-- | xml2cmp/source/xcd/xmlelem.hxx | 2 | ||||
-rw-r--r-- | xml2cmp/source/xcd/xmltree.cxx | 10 | ||||
-rw-r--r-- | xml2cmp/source/xcd/xmltree.hxx | 3 |
8 files changed, 1 insertions, 392 deletions
diff --git a/xml2cmp/Executable_xml2cmp.mk b/xml2cmp/Executable_xml2cmp.mk index 156199fc0a0b..660bc5f8a6dd 100644 --- a/xml2cmp/Executable_xml2cmp.mk +++ b/xml2cmp/Executable_xml2cmp.mk @@ -38,7 +38,6 @@ $(eval $(call gb_Executable_add_exception_objects,xml2cmp,\ xml2cmp/source/support/syshelp \ xml2cmp/source/support/badcast \ xml2cmp/source/xcd/cr_html \ - xml2cmp/source/xcd/cr_index \ xml2cmp/source/xcd/cr_metho \ xml2cmp/source/xcd/filebuff \ xml2cmp/source/xcd/parse \ diff --git a/xml2cmp/source/xcd/cr_index.cxx b/xml2cmp/source/xcd/cr_index.cxx deleted file mode 100644 index ff9c4887de66..000000000000 --- a/xml2cmp/source/xcd/cr_index.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "cr_index.hxx" - -#include <string.h> -#include <fstream> -#include "../support/syshelp.hxx" -#include "xmltree.hxx" -#include "parse.hxx" -#include "cr_html.hxx" - - -extern unsigned C_nSupportedServicesIndex; - -char C_sLineEnd[] = "\n"; - -char C_sFileBegin[] = "<HTML><HEAD></HEAD><BODY bgcolor=\"#ffffff\">\n"; -char C_sFileEnd[] = "</BODY></HTML>\n"; -char C_sTableBegin[] = "<TABLE WIDTH=100% BORDER=1 CELLPADDING=4 CELLSPACING=0><TBODY>\n"; -char C_sTableEnd[] = "</TBODY></TABLE>\n"; -char C_sService[] = "SupportedService"; -char C_sModule[] = "ModuleName"; -char C_sComponentname[] = "ComponentName"; - - - -Simstr sIdlRootPath; - - -Index::Index( const char * i_sOutputDirectory, - const char * i_sIdlRootPath ) - : aService2Module(20), - aModule2Service(20), - sOutputDirectory(i_sOutputDirectory), - sIdlRootPath(i_sIdlRootPath) - // sCurModule -{ - ::sIdlRootPath = i_sIdlRootPath; -} - -Index::~Index() -{ -} - -void -Index::GatherData( const List<Simstr> & i_rInputFileList ) -{ - for ( unsigned i = 0; i < i_rInputFileList.size(); ++i ) - { - ReadFile( i_rInputFileList[i].str() ); - } -} - -void -Index::WriteOutput( const char * i_sOuputFile ) -{ - std::ofstream aOut( i_sOuputFile, std::ios::out ); - if (! aOut) - { - std::cerr << "Error: Indexfile \"" - << i_sOuputFile - << "\" could not be created." - << std::endl; - return; - } - - WriteStr(aOut, C_sFileBegin); - - WriteStr(aOut, "<H2>Module Descriptions Index</H2>"); - WriteStr(aOut, C_sLineEnd ); - - - WriteTableFromHeap( aOut, aService2Module, C_sService, C_sModule, lt_html ); - WriteTableFromHeap( aOut, aModule2Service, C_sModule, C_sService, lt_idl ); - - WriteStr( aOut, C_sFileEnd ); - aOut.close(); -} - -void -Index::InsertSupportedService( const Simstr & i_sService ) -{ - aService2Module.InsertValue( i_sService, sCurModule ); - aModule2Service.InsertValue( sCurModule, i_sService ); -} - -void -Index::ReadFile( const char * i_sFilename ) -{ - static char sOutputHtml[1020]; - - ModuleDescription aModule; - X2CParser aParser(aModule); - - // Parse - bool bResult = aParser.Parse(i_sFilename); - if (! bResult) - { - std::cerr << "Error: File \"" - << i_sFilename - << "\" could not be parsed." - << std::endl; - return; - } - - // Create Html: - CreateHtmlFileName( sOutputHtml, aModule ); - HtmlCreator aHtmlCreator( sOutputHtml, aModule, sIdlRootPath ); - aHtmlCreator.Run(); - - // GetResults: - sCurModule = aModule.ModuleName(); - - List< const MultipleTextElement* > aSupportedServices; - aModule.Get_SupportedServices(aSupportedServices); - - for ( unsigned s = 0; s < aSupportedServices.size(); ++s ) - { - aSupportedServices[s]->Insert2Index(*this); - } -} - -void -Index::CreateHtmlFileName( char * o_sOutputHtml, - const ModuleDescription & i_rModule ) -{ - if ( strlen(sOutputDirectory.str()) + strlen(i_rModule.ModuleName()) > 1000 ) - { - strcpy( o_sOutputHtml, "too-long-filename.html"); // STRCPY SAFE HERE - return; - } - - strcpy( o_sOutputHtml, sOutputDirectory.str() ); // STRCPY SAFE HERE -#if defined(WNT) - strcat(o_sOutputHtml, "\\"); // STRCAT SAFE HERE -#elif defined(UNX) - strcat(o_sOutputHtml, "/"); // STRCAT SAFE HERE -#else -#error WNT or UNX have to be defined. -#endif - strcat( o_sOutputHtml, i_rModule.ModuleName() ); // STRCAT SAFE HERE - strcat( o_sOutputHtml, ".html" ); // STRCAT SAFE HERE -} - - -void -Index::WriteTableFromHeap( std::ostream & o_rOut, - Heap & i_rHeap, - const char * i_sIndexValue, - const char * i_sIndexReference, - E_LinkType i_eLinkType ) -{ - WriteStr(o_rOut, "<H3><BR>"); - WriteStr(o_rOut, i_sIndexValue ); - WriteStr(o_rOut, " -> "); - WriteStr(o_rOut, i_sIndexReference ); - WriteStr(o_rOut, "</H3>\n"); - - WriteStr(o_rOut, C_sTableBegin); - WriteHeap( o_rOut, i_rHeap, i_eLinkType ); - WriteStr(o_rOut, C_sTableEnd); -} - - -void -Index::WriteHeap( std::ostream & o_rOut, - Heap & i_rHeap, - E_LinkType i_eLinkType ) -{ - static Simstr S_sKey; - static char C_sSpaceInName[] = " "; - S_sKey = ""; - - - WriteStr( o_rOut, "<TR><TD width=33% valign=\"top\">" ); - - for ( HeapItem * pHeapTop = i_rHeap.ReleaseTop(); - pHeapTop != 0; - pHeapTop = i_rHeap.ReleaseTop() ) - { - if ( S_sKey != pHeapTop->Key() ) - { - const char * pStart = pHeapTop->Key().str(); - const char * pBreak = strstr( pStart, " in "); - - if (S_sKey.l()>0) - { - WriteStr( o_rOut, "</TD></TR>\n" ); - WriteStr( o_rOut, "<TR><TD width=33% valign=\"top\">" ); - } - - if ( pBreak == 0 ) - WriteStr( o_rOut, pStart ); - else - { - o_rOut.write( pStart, pBreak - pStart ); - WriteStr( o_rOut, C_sSpaceInName ); - WriteStr( o_rOut, pBreak ); - } - WriteStr( o_rOut, "</TD><TD width=66%>" ); - S_sKey = pHeapTop->Key(); - } - else - { - WriteStr( o_rOut, "<BR>" ); - } - WriteName( o_rOut, sIdlRootPath, pHeapTop->Value(), i_eLinkType ); - delete pHeapTop; - } - - WriteStr( o_rOut, "</TD></TR>\n" ); -} - - - -/** Structure overview - -MODULEDESCRIPTION -{ - ModuleName, - COMPONENTDESCRIPTION - { - Author, - Name, - Description, - LoaderName, - Language, - Status, - SupportedService+, - ReferenceDocu* - ServiceDependency* - Type* - } - ProjectBuildDependency* - RuntimeModuleDependency* - ReferenceDocu* - ServiceDependency* - Type* -} - - -*/ - - - - - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xml2cmp/source/xcd/cr_index.hxx b/xml2cmp/source/xcd/cr_index.hxx deleted file mode 100644 index 8cb0668dcba0..000000000000 --- a/xml2cmp/source/xcd/cr_index.hxx +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef X2C_CR_INDEX_HXX -#define X2C_CR_INDEX_HXX - -#include "../support/sistr.hxx" -#include "../support/heap.hxx" -#include "../support/list.hxx" -#include "../support/syshelp.hxx" - - -class ModuleDescription; - - -class Index -{ - public: - Index( - const char * i_sOutputDirectory, - const char * i_sIdlRootPath ); - ~Index(); - - void GatherData( - const List<Simstr> & - i_rInputFileList ); - void WriteOutput( - const char * i_sOuputFile ); - - void InsertSupportedService( - const Simstr & i_sService ); - private: - void ReadFile( - const char * i_sFilename ); - void CreateHtmlFileName( - char * o_sOutputHtml, - const ModuleDescription & - i_rModule ); - void WriteTableFromHeap( - std::ostream & o_rOut, - Heap & i_rHeap, - const char * i_sIndexKey, - const char * i_sIndexReference, - E_LinkType i_eLinkType ); - void WriteHeap( - std::ostream & o_rOut, - Heap & i_rHeap, - E_LinkType i_eLinkType ); - - // DATA - Heap aService2Module; - Heap aModule2Service; - - Simstr sOutputDirectory; - Simstr sIdlRootPath; - - // Temporary Data - Simstr sCurModule; -}; - - - - -#endif - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xml2cmp/source/xcd/main.cxx b/xml2cmp/source/xcd/main.cxx index 5ccaf773ddeb..881173b4e50d 100644 --- a/xml2cmp/source/xcd/main.cxx +++ b/xml2cmp/source/xcd/main.cxx @@ -35,7 +35,6 @@ #include "../support/cmdline.hxx" #include "cr_metho.hxx" #include "cr_html.hxx" -#include "cr_index.hxx" #include "xmlelem.hxx" #include "xmltree.hxx" #include "parse.hxx" @@ -139,7 +138,7 @@ void Create_TypeInfo( const char* o_sOutputFile, ModuleDescription& i_rData ) int Do_DepCommandLine(const CommandLine & i_rCommandLine) { -DependencyFinder aDependencies; + DependencyFinder aDependencies; aDependencies.GatherData(i_rCommandLine.DepPath()); char sInput[500] = ""; diff --git a/xml2cmp/source/xcd/xmlelem.cxx b/xml2cmp/source/xcd/xmlelem.cxx index 3634d076c216..5a795d61c8aa 100644 --- a/xml2cmp/source/xcd/xmlelem.cxx +++ b/xml2cmp/source/xcd/xmlelem.cxx @@ -39,12 +39,6 @@ XmlElement::XmlElement( const char * i_sName ) { } -void -XmlElement::Insert2Index( Index & ) const -{ - // Default version. Does nothing. -} - XmlElement * MultipleElement::FindChild( const Simstr & i_sChildName ) { diff --git a/xml2cmp/source/xcd/xmlelem.hxx b/xml2cmp/source/xcd/xmlelem.hxx index 66ebc4c76fdd..3d00ec757b44 100644 --- a/xml2cmp/source/xcd/xmlelem.hxx +++ b/xml2cmp/source/xcd/xmlelem.hxx @@ -52,8 +52,6 @@ class XmlElement X2CParser & io_rParser ) = 0; virtual void Write2Html( HtmlCreator & io_rHC ) const = 0; - virtual void Insert2Index( - Index & o_rIndex ) const; // Default: Does nothing, but can be overwritten. const Simstr & Name() const { return sName; } diff --git a/xml2cmp/source/xcd/xmltree.cxx b/xml2cmp/source/xcd/xmltree.cxx index 58e7c9278688..ef6dc8a1daf1 100644 --- a/xml2cmp/source/xcd/xmltree.cxx +++ b/xml2cmp/source/xcd/xmltree.cxx @@ -32,7 +32,6 @@ // NOT FULLY DEFINED SERVICES #include <cr_html.hxx> -#include <cr_index.hxx> char C_sMODULEDESCRIPTION[] = "module-description"; @@ -210,15 +209,6 @@ SupportedService::SupportedService() { } -void -SupportedService::Insert2Index( Index & o_rIndex ) const -{ - for ( unsigned i = 0; i < Size(); ++i ) - { - o_rIndex.InsertSupportedService( Data(i) ); - } -} - FreeChoiceElement * Create_ModuleDescrOptional_Element( MultipleTextElement * & o_rTypes, MultipleTextElement * & o_rServiceDependencies ) diff --git a/xml2cmp/source/xcd/xmltree.hxx b/xml2cmp/source/xcd/xmltree.hxx index 9e0bdf05a8e9..48222e418a5b 100644 --- a/xml2cmp/source/xcd/xmltree.hxx +++ b/xml2cmp/source/xcd/xmltree.hxx @@ -134,9 +134,6 @@ class SupportedService : public MultipleTextElement { public: SupportedService(); - - virtual void Insert2Index( - Index & o_rIndex ) const; }; |