StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
BasDBParams.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BAS_BASDBPARAMS_HPP
2 #define __STDAIR_BAS_BASDBPARAMS_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 #include <string>
10 // Stdair
11 #include <stdair/stdair_db.hpp>
13 
14 namespace stdair {
15 
19  struct BasDBParams : public StructAbstract {
20  public:
21  // ///////// Getters ////////
23  const std::string& getUser() const {
24  return _user;
25  }
26 
28  const std::string& getPassword() const {
29  return _passwd;
30  }
31 
33  const std::string& getHost() const {
34  return _host;
35  }
36 
38  const std::string& getPort() const {
39  return _port;
40  }
41 
43  const std::string& getDBName() const {
44  return _dbname;
45  }
46 
47 
48  // ///////// Setters //////////
50  void setUser (const std::string& iUser) {
51  _user = iUser;
52  }
53 
55  void setPassword (const std::string& iPasswd) {
56  _passwd = iPasswd;
57  }
58 
60  void setHost (const std::string& iHost) {
61  _host = iHost;
62  }
63 
65  void setPort (const std::string& iPort) {
66  _port = iPort;
67  }
68 
70  void setDBName (const std::string& iDBName) {
71  _dbname = iDBName;
72  }
73 
74 
75  public:
76  // ///////// Busines methods ////////
80  bool check() const;
81 
82 
83  public:
84  // ///////// Display methods ////////
88  const std::string describe() const;
89 
93  std::string toShortString() const;
94 
98  std::string toString() const;
99 
100 
101  public:
105  BasDBParams (const std::string& iDBUser, const std::string& iDBPasswd,
106  const std::string& iDBHost, const std::string& iDBPort,
107  const std::string& iDBName);
108 
112  BasDBParams();
113 
117  BasDBParams (const BasDBParams&);
118 
122  ~BasDBParams();
123 
124 
125  private:
126  // /////// Attributes /////////
128  std::string _user;
130  std::string _passwd;
132  std::string _host;
134  std::string _port;
136  std::string _dbname;
137  };
138 
139 }
140 #endif // __STDAIR_BAS_BASDBPARAMS_HPP
std::string toString() const
Definition: BasDBParams.cpp:50
Structure holding the parameters for connection to a database.
Definition: BasDBParams.hpp:19
const std::string & getDBName() const
Definition: BasDBParams.hpp:43
Handle on the StdAir library context.
const std::string & getPassword() const
Definition: BasDBParams.hpp:28
const std::string & getUser() const
Definition: BasDBParams.hpp:23
std::string toShortString() const
Definition: BasDBParams.cpp:43
void setPassword(const std::string &iPasswd)
Definition: BasDBParams.hpp:55
Base class for the light structures.
bool check() const
Definition: BasDBParams.cpp:57
void setDBName(const std::string &iDBName)
Definition: BasDBParams.hpp:70
const std::string & getHost() const
Definition: BasDBParams.hpp:33
void setUser(const std::string &iUser)
Definition: BasDBParams.hpp:50
const std::string describe() const
Definition: BasDBParams.cpp:38
const std::string & getPort() const
Definition: BasDBParams.hpp:38
void setPort(const std::string &iPort)
Definition: BasDBParams.hpp:65
void setHost(const std::string &iHost)
Definition: BasDBParams.hpp:60