Remove obsolete xml2cmp -ix.

This commit is contained in:
Stephan Bergmann 2012-01-18 18:03:19 +01:00
parent db7fb9cdf2
commit 10d33da53b
5 changed files with 6 additions and 112 deletions

View file

@ -40,20 +40,13 @@ char C_sUseText[] = "Use: xml2cmp.exe \n"
" [-html htmlFile] \n"
" [-types typeFile] \n"
" [-idlpath idlPath] \n"
" Xml_FileName\n"
" or: xml2cmp.exe \n"
" -ix \n"
" sourceDirectory \n"
" outputDirectory \n"
" [-idlpath idlPath] \n"
" tagname [tagname ...]";
" Xml_FileName\n";
char C_sCmdFunc[] = "-func";
char C_sCmdDep[] = "-dep";
char C_sCmdHtml[] = "-html";
char C_sCmdType[] = "-types";
char C_sCmdIndex[] = "-ix";
char C_sCmdIdlPath[] = "-idlpath";
@ -72,8 +65,6 @@ CommandLine::CommandLine( int argc,
bDisplayUse = true;
else if ( argc == 2 && ! isalnum(argv[1][0]) )
bDisplayUse = true;
else if ( strcmp( argv[1], C_sCmdIndex ) == 0 && argc < 5 )
bDisplayUse = true;
if (bDisplayUse)
{
@ -82,14 +73,7 @@ CommandLine::CommandLine( int argc,
exit(0);
}
if ( strcmp( argv[1], C_sCmdIndex ) == 0 )
{
ParseIndexCommand(argc,argv);
}
else
{
ParseSingleFileCommand(argc,argv);
}
ParseSingleFileCommand(argc,argv);
if ( sXmlSourceFile.l() == 0
&& sXmlSourceDirectory.l() == 0 )
@ -101,15 +85,6 @@ CommandLine::CommandLine( int argc,
{
bIsOk = false;
}
else if ( sIndexFile.l() > 0
&& ( sXmlSourceDirectory.l() == 0
|| aTagsInIndex.size() == 0
)
)
{
bIsOk = false;
}
}
CommandLine::~CommandLine()
@ -128,8 +103,7 @@ CommandLine::ErrorText() const
bool
GetParameter( Simstr & o_pMemory,
int & io_pCountArg,
int argc,
char * argv[] )
int argc, char * argv[] )
{
io_pCountArg++;
if( io_pCountArg < argc )
@ -140,45 +114,6 @@ GetParameter( Simstr & o_pMemory,
return false;
}
void
CommandLine::ParseIndexCommand( int argc,
char * argv[] )
{
int nCountArg = 1;
bIsOk = GetParameter(
sXmlSourceDirectory,
nCountArg,
argc,
argv );
if (bIsOk)
bIsOk = GetParameter(
sOutputDirectory,
nCountArg,
argc,
argv );
if (bIsOk && strcmp( argv[nCountArg+1], C_sCmdIdlPath ) == 0 )
bIsOk = GetParameter(
sIdlRootPath,
++nCountArg,
argc,
argv );
sIndexFile = sOutputDirectory;
#if defined(WNT)
sIndexFile+= "\\xmlindex.html";
#elif defined(UNX)
sIndexFile+= "/xmlindex.html";
#endif
for ( ++nCountArg; nCountArg < argc; ++nCountArg )
{
Simstr sElementName(argv[nCountArg]);
aTagsInIndex.push_back( sElementName );
}
}
void
CommandLine::ParseSingleFileCommand( int argc,
char * argv[] )

View file

@ -30,8 +30,6 @@
#define X2C_CMDLINE_HXX
#include "sistr.hxx"
#include "list.hxx"
class CommandLine
{
@ -50,20 +48,13 @@ class CommandLine
const char * TypeInfoFile() const { return sTypeInfoFile.str(); }
const char * DepPath() const { return sDepPath.str(); }
bool IsIndexCommand() const { return sIndexFile.l() > 0; }
bool IsDepCommand() const { return sDepPath.l() > 0; }
const char * XmlSrcDirectory() const { return sXmlSourceDirectory.str(); }
const char * IndexOutputFile() const { return sIndexFile.str(); }
const char * OutputDirectory() const { return sOutputDirectory.str(); }
const List<Simstr> &
IndexedTags() const { return aTagsInIndex; }
const char * IdlRootPath() const { return sIdlRootPath.str(); }
private:
void ParseIndexCommand(
int argc,
char * argv[] );
void ParseSingleFileCommand(
int argc,
char * argv[] );
@ -73,9 +64,7 @@ class CommandLine
Simstr sTypeInfoFile;
Simstr sXmlSourceDirectory;
Simstr sIndexFile;
Simstr sOutputDirectory;
List<Simstr> aTagsInIndex;
Simstr sIdlRootPath;
Simstr sDepPath;

View file

@ -55,8 +55,7 @@ Simstr sIdlRootPath;
Index::Index( const char * i_sOutputDirectory,
const char * i_sIdlRootPath,
const List<Simstr> & )
const char * i_sIdlRootPath )
: aService2Module(20),
aModule2Service(20),
sOutputDirectory(i_sOutputDirectory),

View file

@ -43,9 +43,7 @@ class Index
public:
Index(
const char * i_sOutputDirectory,
const char * i_sIdlRootPath,
const List<Simstr> &
i_rTagList );
const char * i_sIdlRootPath );
~Index();
void GatherData(

View file

@ -228,29 +228,6 @@ int Do_SingleFileCommandLine(const CommandLine & i_rCommandLine)
return 0;
};
int Do_IndexCommandLine(const CommandLine & i_rCommandLine)
{
// Parse files:
List<Simstr> aFiles;
Index aIndex( i_rCommandLine.OutputDirectory(),
i_rCommandLine.IdlRootPath(),
i_rCommandLine.IndexedTags() );
std::cout << "Gathering xml-files ..." << std::endl;
GatherFileNames( aFiles, i_rCommandLine.XmlSrcDirectory() );
std::cout << "Creating output ..." << std::endl;
aIndex.GatherData(aFiles);
aIndex.WriteOutput( i_rCommandLine.IndexOutputFile() );
std::cout << "... done." << std::endl;
return 0;
};
int
#ifdef WNT
_cdecl
@ -267,11 +244,7 @@ main( int argc, char* argv[] )
return 1;
}
if ( aCommandLine.IsIndexCommand() )
{
ret = Do_IndexCommandLine(aCommandLine);
}
else if ( aCommandLine.IsDepCommand() )
if ( aCommandLine.IsDepCommand() )
{
ret = Do_DepCommandLine(aCommandLine);
}