2
The contents of this file are subject to the Initial Developer's Public
3
License Version 1.0 (the "License"); you may not use this file except in
4
compliance with the License. You may obtain a copy of the License here:
5
http://www.flamerobin.org/license.html.
7
Software distributed under the License is distributed on an "AS IS"
8
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
9
License for the specific language governing rights and limitations under
12
The Original Code is FlameRobin (TM).
14
The Initial Developer of the Original Code is Milan Babuskov.
16
Portions created by the original developer
17
are Copyright (C) 2004 Milan Babuskov.
24
// For compilers that support precompilation, includes "wx/wx.h".
25
#include "wx/wxprec.h"
31
// for all others, include the necessary headers (this file is usually all you
32
// need because it includes almost all "standard" wxWindows headers
38
//------------------------------------------------------------------------------
46
databasesM.setParent(this);
47
databasesM.setType(ntServer);
49
//------------------------------------------------------------------------------
50
bool YServer::getChildren(std::vector<YxMetadataItem *>& temp)
52
return databasesM.getChildren(temp);
54
//------------------------------------------------------------------------------
55
// returns pointer to object in vector
56
YDatabase* YServer::addDatabase(YDatabase& db)
58
YDatabase *temp = databasesM.add(db);
59
temp->setParent(this); // grab it from collection
63
//------------------------------------------------------------------------------
64
void YServer::removeDatabase(YDatabase *db)
66
databasesM.remove(db);
69
//------------------------------------------------------------------------------
70
void YServer::createDatabase(YDatabase *db, std::string extra_params, int dialect)
73
db1 = IBPP::DatabaseFactory( hostnameM, db->getPath(), db->getUsername(), db->getPassword(),
74
"", db->getCharset(), extra_params);
77
//------------------------------------------------------------------------------
78
const YMetadataCollection<YDatabase> *YServer::getDatabases() const
82
//------------------------------------------------------------------------------
83
void YServer::createName() // creates name for the node using hostname and port values
88
databasesM.setName(nameM);
91
//------------------------------------------------------------------------------
92
std::string YServer::getHostname() const
96
//------------------------------------------------------------------------------
97
std::string YServer::getPort() const
101
//------------------------------------------------------------------------------
102
bool YServer::hasConnectedDatabase() const
104
for (YMetadataCollection<YDatabase>::const_iterator it = databasesM.begin();
105
it != databasesM.end(); ++it)
107
if ((*it).isConnected())
112
//------------------------------------------------------------------------------
113
void YServer::setHostname(std::string hostname)
115
hostnameM = hostname;
118
//------------------------------------------------------------------------------
119
void YServer::setPort(std::string port)
124
//------------------------------------------------------------------------------
125
const std::string YServer::getTypeName() const
129
//------------------------------------------------------------------------------