From 9556da13bab524ea9404eb0992ba14cbb08b0588 Mon Sep 17 00:00:00 2001 From: George Tasker Date: Sun, 4 Feb 2001 15:58:39 +0000 Subject: [PATCH] Cleanup of formatting of text Added Initialize() functions to a couple of the helper classes More code changed to reflect new class methods that are now available. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/db.cpp | 48 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/common/db.cpp b/src/common/db.cpp index a58740df04..93d1c6a74c 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -251,6 +251,18 @@ void wxDbConnectInf::SetPassword(const wxString &password) /********** wxDbColFor Constructor **********/ wxDbColFor::wxDbColFor() +{ + Initialize(); +} // wxDbColFor::wxDbColFor() + + +wxDbColFor::~wxDbColFor() +{ +} // wxDbColFor::~wxDbColFor() + + +/********** wxDbColFor::Initialize() **********/ +void wxDbColFor::Initialize() { s_Field.Empty(); int i; @@ -264,12 +276,7 @@ wxDbColFor::wxDbColFor() i_dbDataType = 0; i_sqlDataType = 0; Format(1,DB_DATA_TYPE_VARCHAR,0,0,0); // the Function that does the work -} // wxDbColFor::wxDbColFor() - - -wxDbColFor::~wxDbColFor() -{ -} // wxDbColFor::~wxDbColFor() +} // wxDbColFor::Initialize() /********** wxDbColFor::Format() **********/ @@ -358,6 +365,7 @@ int wxDbColFor::Format(int Nation, int dbDataType, SWORD sqlDataType, } // wxDbColFor::Format() + /********** wxDbColInf Constructor **********/ wxDbColInf::wxDbColInf() { @@ -414,11 +422,8 @@ wxDbTableInf::~wxDbTableInf() /********** wxDbInf Constructor *************/ wxDbInf::wxDbInf() { - catalog[0] = 0; - schema[0] = 0; - numTables = 0; - pTableInf = NULL; -} // wxDbInf::wxDbFor() + Initialize(); +} // wxDbInf::wxDbInf() /********** wxDbInf Destructor *************/ @@ -430,8 +435,18 @@ wxDbInf::~wxDbInf() } // wxDbInf::~wxDbInf() +/********** wxDbInf::Initialize() *************/ +void wxDbInf::Initialize() +{ + catalog[0] = 0; + schema[0] = 0; + numTables = 0; + pTableInf = NULL; +} // wxDbInf::Initialize() + + /********** wxDb Constructors **********/ -wxDb::wxDb(HENV &aHenv, bool FwdOnlyCursors) +wxDb::wxDb(const HENV &aHenv, bool FwdOnlyCursors) { // Copy the HENV into the db class henv = aHenv; @@ -708,6 +723,13 @@ bool wxDb::Open(const wxString &Dsn, const wxString &Uid, const wxString &AuthSt } // wxDb::Open() +bool wxDb::Open(wxDbConnectInf *dbConnectInf) +{ + return Open(dbConnectInf->GetDsn(), dbConnectInf->GetUserID(), + dbConnectInf->GetPassword()); +} // wxDb::Open() + + bool wxDb::Open(wxDb *copyDb) { dsn = copyDb->GetDatasourceName(); @@ -3491,7 +3513,7 @@ wxDb WXDLLEXPORT *wxDbGetConnection(wxDbConnectInf *pDbConfig, bool FwdOnlyCurso pList->Uid = pDbConfig->GetUserID(); pList->AuthStr = pDbConfig->GetPassword(); - pList->PtrDb = new wxDb((HENV)pDbConfig->GetHenvAddress(),FwdOnlyCursors); + pList->PtrDb = new wxDb(pDbConfig->GetHenv(), FwdOnlyCursors); bool opened = FALSE;