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

View File

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

View File

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

View File

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

View File

@@ -228,29 +228,6 @@ int Do_SingleFileCommandLine(const CommandLine & i_rCommandLine)
return 0; 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 int
#ifdef WNT #ifdef WNT
_cdecl _cdecl
@@ -267,11 +244,7 @@ main( int argc, char* argv[] )
return 1; return 1;
} }
if ( aCommandLine.IsIndexCommand() ) if ( aCommandLine.IsDepCommand() )
{
ret = Do_IndexCommandLine(aCommandLine);
}
else if ( aCommandLine.IsDepCommand() )
{ {
ret = Do_DepCommandLine(aCommandLine); ret = Do_DepCommandLine(aCommandLine);
} }