OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
CityDetails.hpp
Go to the documentation of this file.
1#ifndef __OPENTREP_CITYDETAILS_HPP
2#define __OPENTREP_CITYDETAILS_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <iosfwd>
9#include <string>
10// OpenTrep
13#include <opentrep/IATAType.hpp>
14
15namespace OPENTREP {
16
31 public:
32 // //////////////// Getters ///////////////
36 const IATACode_T& getIataCode() const {
37 return _iataCode;
38 }
39
43 const GeonamesID_T& getGeonamesID() const {
44 return _geonamesID;
45 }
46
50 const CityUTFName_T& getUtfName() const {
51 return _utfName;
52 }
53
59 return _asciiName;
60 }
61
66 return _countryCode;
67 }
68
72 const StateCode_T& getStateCode() const {
73 return _stateCode;
74 }
75
76
77 public:
78 // ////////////////// Setters /////////////////
82 void setIataCode (const std::string& iIataCode) {
83 _iataCode = IATACode_T (iIataCode);
84 }
85
89 void setGeonamesID (const GeonamesID_T& iGeonamesID) {
90 _geonamesID = iGeonamesID;
91 }
92
96 void setUtfName (const CityUTFName_T& iUtfName) {
97 _utfName = iUtfName;
98 }
99
104 void setAsciiName (const CityASCIIName_T& iAsciiName) {
105 _asciiName = iAsciiName;
106 }
107
111 void setCountryCode (const std::string& iCountryCode) {
112 _countryCode = CountryCode_T (iCountryCode);
113 }
114
118 void setStateCode (const std::string& iStateCode) {
119 _stateCode = StateCode_T (iStateCode);
120 }
121
122
123 public:
124 // ////////////// Display methods //////////////
130 void toStream (std::ostream&) const;
131
137 void fromStream (std::istream&);
138
142 std::string toString() const;
143
148 std::string describe() const;
149
150
151 public:
152 // ////////////// Constructors and destructors //////////////
156 CityDetails (const IATACode_T&, const GeonamesID_T&,
157 const CityUTFName_T&, const CityASCIIName_T&,
158 const CountryCode_T&, const StateCode_T&);
159
163 CityDetails (const CityDetails&);
164
168 ~CityDetails();
169
173 bool operator== (const CityDetails&) const;
174
178 bool operator!= (const CityDetails& iCityDetails) const {
179 return !(iCityDetails == *this);
180 }
181
182 private:
186 CityDetails();
187
188
189 private:
190 // //////////////////// Attributes ///////////////////////
196 IATACode_T _iataCode;
197
204 GeonamesID_T _geonamesID;
205
209 CityUTFName_T _utfName;
210
215 CityASCIIName_T _asciiName;
216
220 CountryCode_T _countryCode;
221
225 StateCode_T _stateCode;
226
227 };
228
229}
230#endif // __OPENTREP_CITYDETAILS_HPP
unsigned int GeonamesID_T
Class modelling the elementary details of a city.
std::string describe() const
const IATACode_T & getIataCode() const
const GeonamesID_T & getGeonamesID() const
void toStream(std::ostream &) const
std::string toString() const
bool operator==(const CityDetails &) const
void setIataCode(const std::string &iIataCode)
void setGeonamesID(const GeonamesID_T &iGeonamesID)
const StateCode_T & getStateCode() const
void setStateCode(const std::string &iStateCode)
const CountryCode_T & getCountryCode() const
void setAsciiName(const CityASCIIName_T &iAsciiName)
CityDetails(const IATACode_T &, const GeonamesID_T &, const CityUTFName_T &, const CityASCIIName_T &, const CountryCode_T &, const StateCode_T &)
void setUtfName(const CityUTFName_T &iUtfName)
const CityUTFName_T & getUtfName() const
const CityASCIIName_T & getAsciiName() const
void setCountryCode(const std::string &iCountryCode)
bool operator!=(const CityDetails &iCityDetails) const
void fromStream(std::istream &)