From dd70ff8bf32c2d7ed365004b1770058265db1978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 11 Mar 2023 18:15:37 +0100 Subject: New upstream version 4.1.0 --- src/core/xbxbase.cpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'src/core/xbxbase.cpp') diff --git a/src/core/xbxbase.cpp b/src/core/xbxbase.cpp index 7443b26..20b7fcc 100755 --- a/src/core/xbxbase.cpp +++ b/src/core/xbxbase.cpp @@ -24,6 +24,10 @@ xbXBase::xbXBase() { #ifdef XB_LOGGING_SUPPORT xLog = new xbLog(); #endif + + xbFile f( this ); + f.SetHomeFolders(); + } /*************************************************************************/ //! @brief Class Deconstructor. @@ -69,6 +73,53 @@ xbInt16 xbXBase::CloseAllTables(){ } return iRc; } + + + +/*************************************************************************/ +//! @brief Parse commmand line options for a given parm request +/*! + \param lArgc Value passed from main( argc, argv[] ) + \param sArgv Valued passed from main + \param sOptRqst Option to search for in the arguments list + \param sParmOut String token immediately to the right of the the option request, if found + \returns 0 - paramater request not found
1 - Parameter found +*/ + +xbInt16 xbXBase::GetCmdLineOpt( xbInt32 lArgc, char **sArgv, const char *sOptRqst, xbString &sParmOut ){ + xbString sOpt( sOptRqst ); + return GetCmdLineOpt( lArgc, sArgv, sOpt, sParmOut ); +} + +/*************************************************************************/ +//! @brief Parse commmand line options for a given parm request +/*! + \param lArgc Value passed from main( argc, argv[] ) + \param sArgv Valued passed from main + \param sOptRqst Option to search for in the arguments list + \param sParmOut String token immediately to the right of the the option request, if found + \returns 0 - paramater request not found
1 - Parameter found +*/ + +xbInt16 xbXBase::GetCmdLineOpt( xbInt32 lArgc, char **sArgv, xbString &sOptRqst, xbString &sParmOut ){ + + xbInt16 iFound = 0; + sParmOut = ""; + if( lArgc < 2 ) // first string is the program name + return iFound; + + xbInt32 i = 1; + while( iFound == 0 && i < lArgc ){ + if( sOptRqst == sArgv[i] ){ + iFound = 1; + if( i < (lArgc-1)) + sParmOut = sArgv[i+1]; + } + i++; + } + return iFound; +} + /*************************************************************************/ #ifdef XB_LOGGING_SUPPORT //! @brief Get fully qualified log file name. @@ -109,6 +160,7 @@ xbBool xbXBase::GetLogStatus() const { \return void */ void xbXBase::SetLogFileName( const xbString & sLogFileName ){ + xLog->SetFileName( sLogFileName ); } @@ -550,7 +602,7 @@ xbDbf* xbXBase::Open( const xbString &sTableName, xbInt16 &iRc ){ \param iOpenMode - XB_READ_WRITE or XB_READ \param iShareMode - XB_SINGLE_USER or XB_MULTI_USER \param iRequestVersion 0 - Highest available - 4 - Version four dbf + 4 - Version four dbf 3 - Version three dbf \param iRc - Return code from open request \returns param dbf - Output pointer to dbf file opened or null if error -- cgit v1.2.3