Move files to ripple_app

This commit is contained in:
Vinnie Falco
2013-07-10 15:41:44 -07:00
parent 740115b65a
commit 169bac3640
45 changed files with 136 additions and 299 deletions

View File

@@ -0,0 +1,32 @@
//------------------------------------------------------------------------------
/*
Copyright (c) 2011-2013, OpenCoin, Inc.
*/
//==============================================================================
int DatabaseCon::sCount = 0;
DatabaseCon::DatabaseCon (const std::string& strName, const char* initStrings[], int initCount)
{
++sCount;
// VFALCO TODO remove this dependency on the config by making it the caller's
// responsibility to pass in the path. Add a member function to Application
// or Config to compute this path.
//
boost::filesystem::path pPath = (theConfig.RUN_STANDALONE && (theConfig.START_UP != Config::LOAD))
? "" // Use temporary files.
: (theConfig.DATA_DIR / strName); // Use regular db files.
mDatabase = new SqliteDatabase (pPath.string ().c_str ());
mDatabase->connect ();
for (int i = 0; i < initCount; ++i)
mDatabase->executeSQL (initStrings[i], true);
}
DatabaseCon::~DatabaseCon ()
{
mDatabase->disconnect ();
delete mDatabase;
}