Commit 68988f2c authored by Steven Murray's avatar Steven Murray
Browse files

Added Login::parseInMemory()

parent b53fdc3d
......@@ -92,7 +92,7 @@ Login Login::parseString(const std::string &connectionString) {
const auto typeAndDetails = parseDbTypeAndConnectionDetails(connectionString);
if(typeAndDetails.dbTypeStr == "in_memory") {
return Login(DBTYPE_IN_MEMORY, "", "", "", "", 0);
return parseInMemory(typeAndDetails.connectionDetails);
} else if(typeAndDetails.dbTypeStr == "oracle") {
return parseOracle(typeAndDetails.connectionDetails);
} else if(typeAndDetails.dbTypeStr == "sqlite") {
......@@ -155,6 +155,16 @@ std::list<std::string> Login::readNonEmptyLines(std::istream &inputStream) {
return lines;
}
//------------------------------------------------------------------------------
// parseInMemory
//------------------------------------------------------------------------------
Login Login::parseInMemory(const std::string &connectionDetails) {
if(!connectionDetails.empty()) {
throw exception::Exception(std::string("Invalid connection string: Correct format is ") + s_fileFormat);
}
return Login(DBTYPE_IN_MEMORY, "", "", "", "", 0);
}
//------------------------------------------------------------------------------
// parseOracle
//------------------------------------------------------------------------------
......
......@@ -162,6 +162,14 @@ struct Login {
*/
static DbTypeAndConnectionDetails parseDbTypeAndConnectionDetails(const std::string &connectionString);
/**
* Parses the specified "in memory" database connection details.
*
* @param connectionDetails The connection details of an "in memory" databasei
* must be the empty string.
*/
static Login parseInMemory(const std::string &connectionDetails);
/**
* Parses the specified Oracle database connection details.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment