1.00.8
C++ Standard Airline IT Object Library
BasDBParams.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
#include <sstream>
7
// StdAir
8
#include <
stdair/basic/BasDBParams.hpp
>
9
10
namespace
stdair
{
11
12
// //////////////////////////////////////////////////////////////////////
13
BasDBParams::BasDBParams
() {
14
}
15
16
// //////////////////////////////////////////////////////////////////////
17
BasDBParams::BasDBParams
(
const
BasDBParams
& iDBParams)
18
: _user (iDBParams._user), _passwd (iDBParams._passwd),
19
_host (iDBParams._host), _port (iDBParams._port),
20
_dbname (iDBParams._dbname) {
21
}
22
23
// //////////////////////////////////////////////////////////////////////
24
BasDBParams::BasDBParams
(
const
std::string& iDBUser,
25
const
std::string& iDBPasswd,
26
const
std::string& iDBHost,
27
const
std::string& iDBPort,
28
const
std::string& iDBName)
29
: _user (iDBUser), _passwd (iDBPasswd), _host (iDBHost), _port (iDBPort),
30
_dbname (iDBName) {
31
}
32
33
// //////////////////////////////////////////////////////////////////////
34
BasDBParams::~BasDBParams
() {
35
}
36
37
// //////////////////////////////////////////////////////////////////////
38
const
std::string
BasDBParams::describe
()
const
{
39
return
toString
();
40
}
41
42
// //////////////////////////////////////////////////////////////////////
43
std::string
BasDBParams::toShortString
()
const
{
44
std::ostringstream oStr;
45
oStr << _dbname <<
"."
<< _user <<
"@"
<< _host <<
":"
<< _port;
46
return
oStr.str();
47
}
48
49
// //////////////////////////////////////////////////////////////////////
50
std::string
BasDBParams::toString
()
const
{
51
std::ostringstream oStr;
52
oStr << _dbname <<
"."
<< _user <<
"@"
<< _host <<
":"
<< _port;
53
return
oStr.str();
54
}
55
56
// //////////////////////////////////////////////////////////////////////
57
bool
BasDBParams::check
()
const
{
58
if
(_user.empty() ==
true
|| _passwd.empty() ==
true
59
|| _host.empty() ==
true
|| _port.empty()
60
|| _dbname.empty() ==
true
) {
61
return
false
;
62
}
63
return
true
;
64
}
65
66
}
stdair::BasDBParams::toShortString
std::string toShortString() const
Definition:
BasDBParams.cpp:43
stdair::BasDBParams::check
bool check() const
Definition:
BasDBParams.cpp:57
stdair::BasDBParams::toString
std::string toString() const
Definition:
BasDBParams.cpp:50
stdair::BasDBParams::describe
const std::string describe() const
Definition:
BasDBParams.cpp:38
stdair::BasDBParams::BasDBParams
BasDBParams()
Definition:
BasDBParams.cpp:13
stdair
Handle on the StdAir library context.
Definition:
BasChronometer.cpp:9
BasDBParams.hpp
stdair::BasDBParams
Structure holding the parameters for connection to a database.
Definition:
BasDBParams.hpp:19
stdair::BasDBParams::~BasDBParams
~BasDBParams()
Definition:
BasDBParams.cpp:34
Generated for StdAir by
1.8.16