@ -54,7 +54,7 @@
# endif
# endif
template class TQAsciiDict < TQCString > ;
template class TQAsciiDict < TQCString > ;
template class TQPtrList < K CmdLineArgs> ;
template class TQPtrList < TDE CmdLineArgs> ;
class KCmdLineParsedOptions : public TQAsciiDict < TQCString >
class KCmdLineParsedOptions : public TQAsciiDict < TQCString >
{
{
@ -104,27 +104,27 @@ public:
} ;
} ;
class KCmdLineArgsList: public TQPtrList < K CmdLineArgs>
class TDECmdLineArgsList: public TQPtrList < TDE CmdLineArgs>
{
{
public :
public :
K CmdLineArgsList( ) { }
TDE CmdLineArgsList( ) { }
} ;
} ;
KCmdLineArgsList * K CmdLineArgs: : argsList = 0 ;
TDECmdLineArgsList * TDE CmdLineArgs: : argsList = 0 ;
int K CmdLineArgs: : argc = 0 ;
int TDE CmdLineArgs: : argc = 0 ;
char * * K CmdLineArgs: : argv = 0 ;
char * * TDE CmdLineArgs: : argv = 0 ;
char * K CmdLineArgs: : mCwd = 0 ;
char * TDE CmdLineArgs: : mCwd = 0 ;
static KStaticDeleter < char > mCwdd ;
static KStaticDeleter < char > mCwdd ;
const KAboutData * K CmdLineArgs: : about = 0 ;
const KAboutData * TDE CmdLineArgs: : about = 0 ;
bool K CmdLineArgs: : parsed = false ;
bool TDE CmdLineArgs: : parsed = false ;
bool K CmdLineArgs: : ignoreUnknown = false ;
bool TDE CmdLineArgs: : ignoreUnknown = false ;
//
//
// Static functions
// Static functions
//
//
void
void
K CmdLineArgs: : init ( int _argc , char * * _argv , const char * _appname , const char * programName ,
TDE CmdLineArgs: : init ( int _argc , char * * _argv , const char * _appname , const char * programName ,
const char * _description , const char * _version , bool noKApp )
const char * _description , const char * _version , bool noKApp )
{
{
init ( _argc , _argv ,
init ( _argc , _argv ,
@ -133,7 +133,7 @@ KCmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* pr
}
}
void
void
K CmdLineArgs: : init ( int _argc , char * * _argv , const char * _appname ,
TDE CmdLineArgs: : init ( int _argc , char * * _argv , const char * _appname ,
const char * _description , const char * _version , bool noKApp )
const char * _description , const char * _version , bool noKApp )
{
{
init ( _argc , _argv ,
init ( _argc , _argv ,
@ -142,7 +142,7 @@ KCmdLineArgs::init(int _argc, char **_argv, const char *_appname,
}
}
void
void
K CmdLineArgs: : initIgnore ( int _argc , char * * _argv , const char * _appname )
TDE CmdLineArgs: : initIgnore ( int _argc , char * * _argv , const char * _appname )
{
{
init ( _argc , _argv ,
init ( _argc , _argv ,
new KAboutData ( _appname , _appname , " unknown " , " TDE Application " , false ) ) ;
new KAboutData ( _appname , _appname , " unknown " , " TDE Application " , false ) ) ;
@ -150,7 +150,7 @@ KCmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname )
}
}
void
void
K CmdLineArgs: : init ( const KAboutData * ab )
TDE CmdLineArgs: : init ( const KAboutData * ab )
{
{
char * * _argv = ( char * * ) malloc ( sizeof ( char * ) ) ;
char * * _argv = ( char * * ) malloc ( sizeof ( char * ) ) ;
_argv [ 0 ] = ( char * ) ab - > appName ( ) ;
_argv [ 0 ] = ( char * ) ab - > appName ( ) ;
@ -159,14 +159,14 @@ KCmdLineArgs::init(const KAboutData* ab)
void
void
K CmdLineArgs: : init ( int _argc , char * * _argv , const KAboutData * _about , bool noKApp )
TDE CmdLineArgs: : init ( int _argc , char * * _argv , const KAboutData * _about , bool noKApp )
{
{
argc = _argc ;
argc = _argc ;
argv = _argv ;
argv = _argv ;
if ( ! argv )
if ( ! argv )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs):\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs):\n " ) ;
fprintf ( stderr , " Passing null-pointer to 'argv' is not allowed. \n \n " ) ;
fprintf ( stderr , " Passing null-pointer to 'argv' is not allowed. \n \n " ) ;
assert ( 0 ) ;
assert ( 0 ) ;
@ -191,30 +191,30 @@ KCmdLineArgs::init(int _argc, char **_argv, const KAboutData *_about, bool noKAp
KApplication : : addCmdLineOptions ( ) ;
KApplication : : addCmdLineOptions ( ) ;
}
}
TQString K CmdLineArgs: : cwd ( )
TQString TDE CmdLineArgs: : cwd ( )
{
{
return TQFile : : decodeName ( TQCString ( mCwd ) ) ;
return TQFile : : decodeName ( TQCString ( mCwd ) ) ;
}
}
const char * K CmdLineArgs: : appName ( )
const char * TDE CmdLineArgs: : appName ( )
{
{
if ( ! argc ) return 0 ;
if ( ! argc ) return 0 ;
return argv [ 0 ] ;
return argv [ 0 ] ;
}
}
void
void
K CmdLineArgs: : addCmdLineOptions ( const KCmdLineOptions * options , const char * name ,
TDE CmdLineArgs: : addCmdLineOptions ( const KCmdLineOptions * options , const char * name ,
const char * id , const char * afterId )
const char * id , const char * afterId )
{
{
if ( ! argsList )
if ( ! argsList )
argsList = new K CmdLineArgsList( ) ;
argsList = new TDE CmdLineArgsList( ) ;
int pos = argsList - > count ( ) ;
int pos = argsList - > count ( ) ;
if ( pos & & id & & argsList - > last ( ) & & ! argsList - > last ( ) - > name )
if ( pos & & id & & argsList - > last ( ) & & ! argsList - > last ( ) - > name )
pos - - ;
pos - - ;
K CmdLineArgs * args ;
TDE CmdLineArgs * args ;
int i = 0 ;
int i = 0 ;
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) , i + + )
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) , i + + )
{
{
@ -230,12 +230,12 @@ KCmdLineArgs::addCmdLineOptions( const KCmdLineOptions *options, const char *nam
assert ( parsed = = false ) ; // You must add _ALL_ cmd line options
assert ( parsed = = false ) ; // You must add _ALL_ cmd line options
// before accessing the arguments!
// before accessing the arguments!
args = new K CmdLineArgs( options , name , id ) ;
args = new TDE CmdLineArgs( options , name , id ) ;
argsList - > insert ( pos , args ) ;
argsList - > insert ( pos , args ) ;
}
}
void
void
K CmdLineArgs: : saveAppArgs ( TQDataStream & ds )
TDE CmdLineArgs: : saveAppArgs ( TQDataStream & ds )
{
{
if ( ! parsed )
if ( ! parsed )
parseAllArgs ( ) ;
parseAllArgs ( ) ;
@ -252,7 +252,7 @@ KCmdLineArgs::saveAppArgs( TQDataStream &ds)
if ( ! count ) return ;
if ( ! count ) return ;
K CmdLineArgs * args ;
TDE CmdLineArgs * args ;
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) )
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) )
{
{
ds < < TQCString ( args - > id ) ;
ds < < TQCString ( args - > id ) ;
@ -261,7 +261,7 @@ KCmdLineArgs::saveAppArgs( TQDataStream &ds)
}
}
void
void
K CmdLineArgs: : loadAppArgs ( TQDataStream & ds )
TDE CmdLineArgs: : loadAppArgs ( TQDataStream & ds )
{
{
parsed = true ; // don't reparse argc/argv!
parsed = true ; // don't reparse argc/argv!
@ -269,7 +269,7 @@ KCmdLineArgs::loadAppArgs( TQDataStream &ds)
removeArgs ( " qt " ) ;
removeArgs ( " qt " ) ;
removeArgs ( " tde " ) ;
removeArgs ( " tde " ) ;
K CmdLineArgs * args ;
TDE CmdLineArgs * args ;
if ( argsList ) {
if ( argsList ) {
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) )
for ( args = argsList - > first ( ) ; args ; args = argsList - > next ( ) )
{
{
@ -307,9 +307,9 @@ KCmdLineArgs::loadAppArgs( TQDataStream &ds)
parsed = true ;
parsed = true ;
}
}
KCmdLineArgs * K CmdLineArgs: : parsedArgs ( const char * id )
TDECmdLineArgs * TDE CmdLineArgs: : parsedArgs ( const char * id )
{
{
K CmdLineArgs * args = argsList ? argsList - > first ( ) : 0 ;
TDE CmdLineArgs * args = argsList ? argsList - > first ( ) : 0 ;
while ( args )
while ( args )
{
{
if ( ( id & & : : qstrcmp ( args - > id , id ) = = 0 ) | | ( ! id & & ! args - > id ) )
if ( ( id & & : : qstrcmp ( args - > id , id ) = = 0 ) | | ( ! id & & ! args - > id ) )
@ -324,9 +324,9 @@ KCmdLineArgs *KCmdLineArgs::parsedArgs(const char *id)
return args ;
return args ;
}
}
void K CmdLineArgs: : removeArgs ( const char * id )
void TDE CmdLineArgs: : removeArgs ( const char * id )
{
{
K CmdLineArgs * args = argsList ? argsList - > first ( ) : 0 ;
TDE CmdLineArgs * args = argsList ? argsList - > first ( ) : 0 ;
while ( args )
while ( args )
{
{
if ( args - > id & & id & & : : qstrcmp ( args - > id , id ) = = 0 )
if ( args - > id & & id & & : : qstrcmp ( args - > id , id ) = = 0 )
@ -426,9 +426,9 @@ findOption(const KCmdLineOptions *options, TQCString &opt,
void
void
K CmdLineArgs: : findOption ( const char * _opt , TQCString opt , int & i , bool _enabled , bool & moreOptions )
TDE CmdLineArgs: : findOption ( const char * _opt , TQCString opt , int & i , bool _enabled , bool & moreOptions )
{
{
K CmdLineArgs * args = argsList - > first ( ) ;
TDE CmdLineArgs * args = argsList - > first ( ) ;
const char * opt_name ;
const char * opt_name ;
const char * def ;
const char * def ;
TQCString argument ;
TQCString argument ;
@ -534,19 +534,19 @@ KCmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled,
}
}
void
void
K CmdLineArgs: : printQ ( const TQString & msg )
TDE CmdLineArgs: : printQ ( const TQString & msg )
{
{
TQCString localMsg = msg . local8Bit ( ) ;
TQCString localMsg = msg . local8Bit ( ) ;
fprintf ( stdout , " %s " , localMsg . data ( ) ) ;
fprintf ( stdout , " %s " , localMsg . data ( ) ) ;
}
}
void
void
K CmdLineArgs: : parseAllArgs ( )
TDE CmdLineArgs: : parseAllArgs ( )
{
{
bool allowArgs = false ;
bool allowArgs = false ;
bool inOptions = true ;
bool inOptions = true ;
bool everythingAfterArgIsArgs = false ;
bool everythingAfterArgIsArgs = false ;
K CmdLineArgs * appOptions = argsList - > last ( ) ;
TDE CmdLineArgs * appOptions = argsList - > last ( ) ;
if ( ! appOptions - > id )
if ( ! appOptions - > id )
{
{
const KCmdLineOptions * option = appOptions - > options ;
const KCmdLineOptions * option = appOptions - > options ;
@ -676,7 +676,7 @@ KCmdLineArgs::parseAllArgs()
* Return argc
* Return argc
*/
*/
int *
int *
K CmdLineArgs: : tqt_argc ( )
TDE CmdLineArgs: : tqt_argc ( )
{
{
if ( ! argsList )
if ( ! argsList )
KApplication : : addCmdLineOptions ( ) ; // Lazy bastards!
KApplication : : addCmdLineOptions ( ) ; // Lazy bastards!
@ -685,12 +685,12 @@ KCmdLineArgs::tqt_argc()
if ( tqt_argc ! = - 1 )
if ( tqt_argc ! = - 1 )
return & tqt_argc ;
return & tqt_argc ;
K CmdLineArgs * args = parsedArgs ( " qt " ) ;
TDE CmdLineArgs * args = parsedArgs ( " qt " ) ;
assert ( args ) ; // No qt options have been added!
assert ( args ) ; // No qt options have been added!
if ( ! argv )
if ( ! argv )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs):\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs):\n " ) ;
fprintf ( stderr , " Application has not called K CmdLineArgs::init(...).\n \n " ) ;
fprintf ( stderr , " Application has not called TDE CmdLineArgs::init(...).\n \n " ) ;
assert ( 0 ) ;
assert ( 0 ) ;
exit ( 255 ) ;
exit ( 255 ) ;
@ -707,7 +707,7 @@ KCmdLineArgs::tqt_argc()
* Return argv
* Return argv
*/
*/
char * * *
char * * *
K CmdLineArgs: : tqt_argv ( )
TDE CmdLineArgs: : tqt_argv ( )
{
{
if ( ! argsList )
if ( ! argsList )
KApplication : : addCmdLineOptions ( ) ; // Lazy bastards!
KApplication : : addCmdLineOptions ( ) ; // Lazy bastards!
@ -716,12 +716,12 @@ KCmdLineArgs::tqt_argv()
if ( tqt_argv ! = NULL )
if ( tqt_argv ! = NULL )
return & tqt_argv ;
return & tqt_argv ;
K CmdLineArgs * args = parsedArgs ( " qt " ) ;
TDE CmdLineArgs * args = parsedArgs ( " qt " ) ;
assert ( args ) ; // No qt options have been added!
assert ( args ) ; // No qt options have been added!
if ( ! argv )
if ( ! argv )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs):\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs):\n " ) ;
fprintf ( stderr , " Application has not called K CmdLineArgs::init(...).\n \n " ) ;
fprintf ( stderr , " Application has not called TDE CmdLineArgs::init(...).\n \n " ) ;
assert ( 0 ) ;
assert ( 0 ) ;
exit ( 255 ) ;
exit ( 255 ) ;
@ -740,7 +740,7 @@ KCmdLineArgs::tqt_argv()
}
}
void
void
K CmdLineArgs: : enable_i18n ( )
TDE CmdLineArgs: : enable_i18n ( )
{
{
// called twice or too late
// called twice or too late
if ( KGlobal : : _locale )
if ( KGlobal : : _locale )
@ -754,7 +754,7 @@ KCmdLineArgs::enable_i18n()
}
}
void
void
K CmdLineArgs: : usage ( const TQString & error )
TDE CmdLineArgs: : usage ( const TQString & error )
{
{
assert ( KGlobal : : _locale ) ;
assert ( KGlobal : : _locale ) ;
TQCString localError = error . local8Bit ( ) ;
TQCString localError = error . local8Bit ( ) ;
@ -769,7 +769,7 @@ KCmdLineArgs::usage(const TQString &error)
}
}
void
void
K CmdLineArgs: : usage ( const char * id )
TDE CmdLineArgs: : usage ( const char * id )
{
{
enable_i18n ( ) ;
enable_i18n ( ) ;
assert ( argsList ! = 0 ) ; // It's an error to call usage(...) without
assert ( argsList ! = 0 ) ; // It's an error to call usage(...) without
@ -781,7 +781,7 @@ KCmdLineArgs::usage(const char *id)
TQString tmp ;
TQString tmp ;
TQString usage ;
TQString usage ;
K CmdLineArgs * args = argsList - > last ( ) ;
TDE CmdLineArgs * args = argsList - > last ( ) ;
if ( ! ( args - > id ) & & ( args - > options ) & &
if ( ! ( args - > id ) & & ( args - > options ) & &
( args - > options - > name ) & & ( args - > options - > name [ 0 ] ! = ' + ' ) )
( args - > options - > name ) & & ( args - > options - > name [ 0 ] ! = ' + ' ) )
@ -798,7 +798,7 @@ KCmdLineArgs::usage(const char *id)
args = argsList - > prev ( ) ;
args = argsList - > prev ( ) ;
}
}
K CmdLineArgs * appOptions = argsList - > last ( ) ;
TDE CmdLineArgs * appOptions = argsList - > last ( ) ;
if ( ! appOptions - > id )
if ( ! appOptions - > id )
{
{
const KCmdLineOptions * option = appOptions - > options ;
const KCmdLineOptions * option = appOptions - > options ;
@ -986,7 +986,7 @@ KCmdLineArgs::usage(const char *id)
*
*
* The given arguments are assumed to be constants .
* The given arguments are assumed to be constants .
*/
*/
KCmdLineArgs: : K CmdLineArgs( const KCmdLineOptions * _options ,
TDECmdLineArgs: : TDE CmdLineArgs( const KCmdLineOptions * _options ,
const char * _name , const char * _id )
const char * _name , const char * _id )
: options ( _options ) , name ( _name ) , id ( _id )
: options ( _options ) , name ( _name ) , id ( _id )
{
{
@ -998,7 +998,7 @@ KCmdLineArgs::KCmdLineArgs( const KCmdLineOptions *_options,
/**
/**
* Destructor .
* Destructor .
*/
*/
KCmdLineArgs: : ~ K CmdLineArgs( )
TDECmdLineArgs: : ~ TDE CmdLineArgs( )
{
{
delete parsedOptionList ;
delete parsedOptionList ;
delete parsedArgList ;
delete parsedArgList ;
@ -1007,7 +1007,7 @@ KCmdLineArgs::~KCmdLineArgs()
}
}
void
void
K CmdLineArgs: : clear ( )
TDE CmdLineArgs: : clear ( )
{
{
delete parsedArgList ;
delete parsedArgList ;
parsedArgList = 0 ;
parsedArgList = 0 ;
@ -1016,7 +1016,7 @@ KCmdLineArgs::clear()
}
}
void
void
K CmdLineArgs: : reset ( )
TDE CmdLineArgs: : reset ( )
{
{
if ( argsList ) {
if ( argsList ) {
argsList - > setAutoDelete ( true ) ;
argsList - > setAutoDelete ( true ) ;
@ -1028,7 +1028,7 @@ KCmdLineArgs::reset()
}
}
void
void
K CmdLineArgs: : save ( TQDataStream & ds ) const
TDE CmdLineArgs: : save ( TQDataStream & ds ) const
{
{
uint count = 0 ;
uint count = 0 ;
if ( parsedOptionList )
if ( parsedOptionList )
@ -1043,7 +1043,7 @@ KCmdLineArgs::save( TQDataStream &ds) const
}
}
void
void
K CmdLineArgs: : load ( TQDataStream & ds )
TDE CmdLineArgs: : load ( TQDataStream & ds )
{
{
if ( ! parsedOptionList ) parsedOptionList = new KCmdLineParsedOptions ;
if ( ! parsedOptionList ) parsedOptionList = new KCmdLineParsedOptions ;
if ( ! parsedArgList ) parsedArgList = new KCmdLineParsedArgs ;
if ( ! parsedArgList ) parsedArgList = new KCmdLineParsedArgs ;
@ -1064,7 +1064,7 @@ KCmdLineArgs::load( TQDataStream &ds)
}
}
void
void
K CmdLineArgs: : setOption ( const TQCString & opt , bool enabled )
TDE CmdLineArgs: : setOption ( const TQCString & opt , bool enabled )
{
{
if ( isQt )
if ( isQt )
{
{
@ -1087,7 +1087,7 @@ KCmdLineArgs::setOption(const TQCString &opt, bool enabled)
}
}
void
void
K CmdLineArgs: : setOption ( const TQCString & opt , const char * value )
TDE CmdLineArgs: : setOption ( const TQCString & opt , const char * value )
{
{
if ( isQt )
if ( isQt )
{
{
@ -1114,7 +1114,7 @@ KCmdLineArgs::setOption(const TQCString &opt, const char *value)
}
}
TQCString
TQCString
K CmdLineArgs: : getOption ( const char * _opt ) const
TDE CmdLineArgs: : getOption ( const char * _opt ) const
{
{
TQCString * value = 0 ;
TQCString * value = 0 ;
if ( parsedOptionList )
if ( parsedOptionList )
@ -1134,7 +1134,7 @@ KCmdLineArgs::getOption(const char *_opt) const
if ( result ! = 3 )
if ( result ! = 3 )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs):\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs):\n " ) ;
fprintf ( stderr , " Application requests for getOption( \" %s \" ) but the \" %s \" option \n " ,
fprintf ( stderr , " Application requests for getOption( \" %s \" ) but the \" %s \" option \n " ,
_opt , _opt ) ;
_opt , _opt ) ;
fprintf ( stderr , " has never been specified via addCmdLineOptions( ... ) \n \n " ) ;
fprintf ( stderr , " has never been specified via addCmdLineOptions( ... ) \n \n " ) ;
@ -1146,7 +1146,7 @@ KCmdLineArgs::getOption(const char *_opt) const
}
}
QCStringList
QCStringList
K CmdLineArgs: : getOptionList ( const char * _opt ) const
TDE CmdLineArgs: : getOptionList ( const char * _opt ) const
{
{
QCStringList result ;
QCStringList result ;
if ( ! parsedOptionList )
if ( ! parsedOptionList )
@ -1176,7 +1176,7 @@ KCmdLineArgs::getOptionList(const char *_opt) const
}
}
bool
bool
K CmdLineArgs: : isSet ( const char * _opt ) const
TDE CmdLineArgs: : isSet ( const char * _opt ) const
{
{
// Look up the default.
// Look up the default.
const char * opt_name ;
const char * opt_name ;
@ -1187,7 +1187,7 @@ KCmdLineArgs::isSet(const char *_opt) const
if ( result = = 0 )
if ( result = = 0 )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs):\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs):\n " ) ;
fprintf ( stderr , " Application requests for isSet( \" %s \" ) but the \" %s \" option \n " ,
fprintf ( stderr , " Application requests for isSet( \" %s \" ) but the \" %s \" option \n " ,
_opt , _opt ) ;
_opt , _opt ) ;
fprintf ( stderr , " has never been specified via addCmdLineOptions( ... ) \n \n " ) ;
fprintf ( stderr , " has never been specified via addCmdLineOptions( ... ) \n \n " ) ;
@ -1219,7 +1219,7 @@ KCmdLineArgs::isSet(const char *_opt) const
}
}
int
int
K CmdLineArgs: : count ( ) const
TDE CmdLineArgs: : count ( ) const
{
{
if ( ! parsedArgList )
if ( ! parsedArgList )
return 0 ;
return 0 ;
@ -1227,11 +1227,11 @@ KCmdLineArgs::count() const
}
}
const char *
const char *
K CmdLineArgs: : arg ( int n ) const
TDE CmdLineArgs: : arg ( int n ) const
{
{
if ( ! parsedArgList | | ( n > = ( int ) parsedArgList - > count ( ) ) )
if ( ! parsedArgList | | ( n > = ( int ) parsedArgList - > count ( ) ) )
{
{
fprintf ( stderr , " \n \n FAILURE ( K CmdLineArgs): Argument out of bounds\n " ) ;
fprintf ( stderr , " \n \n FAILURE ( TDE CmdLineArgs): Argument out of bounds\n " ) ;
fprintf ( stderr , " Application requests for arg(%d) without checking count() first. \n " ,
fprintf ( stderr , " Application requests for arg(%d) without checking count() first. \n " ,
n ) ;
n ) ;
@ -1243,12 +1243,12 @@ KCmdLineArgs::arg(int n) const
}
}
KURL
KURL
K CmdLineArgs: : url ( int n ) const
TDE CmdLineArgs: : url ( int n ) const
{
{
return makeURL ( arg ( n ) ) ;
return makeURL ( arg ( n ) ) ;
}
}
KURL K CmdLineArgs: : makeURL ( const char * _urlArg )
KURL TDE CmdLineArgs: : makeURL ( const char * _urlArg )
{
{
const TQString urlArg = TQFile : : decodeName ( _urlArg ) ;
const TQString urlArg = TQFile : : decodeName ( _urlArg ) ;
TQFileInfo fileInfo ( urlArg ) ;
TQFileInfo fileInfo ( urlArg ) ;
@ -1269,7 +1269,7 @@ KURL KCmdLineArgs::makeURL(const char *_urlArg)
}
}
void
void
K CmdLineArgs: : addArgument ( const char * argument )
TDE CmdLineArgs: : addArgument ( const char * argument )
{
{
if ( ! parsedArgList )
if ( ! parsedArgList )
parsedArgList = new KCmdLineParsedArgs ;
parsedArgList = new KCmdLineParsedArgs ;
@ -1284,14 +1284,14 @@ static const KCmdLineOptions kde_tempfile_option[] =
} ;
} ;
void
void
K CmdLineArgs: : addTempFileOption ( )
TDE CmdLineArgs: : addTempFileOption ( )
{
{
K CmdLineArgs: : addCmdLineOptions ( kde_tempfile_option , " TDE-tempfile " , " tde-tempfile " ) ;
TDE CmdLineArgs: : addCmdLineOptions ( kde_tempfile_option , " TDE-tempfile " , " tde-tempfile " ) ;
}
}
bool K CmdLineArgs: : isTempFileSet ( )
bool TDE CmdLineArgs: : isTempFileSet ( )
{
{
KCmdLineArgs* args = K CmdLineArgs: : parsedArgs ( " tde-tempfile " ) ;
TDECmdLineArgs* args = TDE CmdLineArgs: : parsedArgs ( " tde-tempfile " ) ;
if ( args )
if ( args )
return args - > isSet ( " tempfile " ) ;
return args - > isSet ( " tempfile " ) ;
return false ;
return false ;