diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-03-11 18:15:37 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-03-11 18:15:37 +0100 |
commit | dd70ff8bf32c2d7ed365004b1770058265db1978 (patch) | |
tree | 084788d142d86c4dc38f5c48606523b4040596e6 /src/core/xbxbase.cpp | |
parent | 517ad9d4b6eae320b708d03a9340a22893b0cab7 (diff) |
New upstream version 4.1.0upstream/4.1.0
Diffstat (limited to 'src/core/xbxbase.cpp')
-rwxr-xr-x | src/core/xbxbase.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
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<br> 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<br> 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 |