42 #ifndef _DWMCOUNTRYCODES_HH_ 43 #define _DWMCOUNTRYCODES_HH_ 49 #include "DwmReadable.hh" 50 #include "DwmWritable.hh" 60 :
public Dwm::Readable,
public Dwm::Writable
74 std::vector<CountryCode> FindByNameRegExp(
const std::string & rgxp)
const;
80 bool ReadJson(
const std::string & fileName);
86 bool WriteJson(
const std::string & fileName)
const;
91 std::istream &
Read(std::istream & is);
103 size_t Read(FILE *f);
108 std::ostream &
Write(std::ostream & os)
const;
114 ssize_t
Write(
int fd)
const;
120 size_t Write(FILE *f)
const;
133 return (_a2toCountryCode == countryCodes._a2toCountryCode);
137 std::map<std::string,CountryCode> _a2toCountryCode;
138 std::map<std::string,CountryCode> _a3toCountryCode;
143 #endif // _DWMCOUNTRYCODES_HH_ Encapsulates country code information.
Definition: DwmCountryCode.hh:59
Definition: DwmCountryCode.hh:53
uint32_t StreamedLength() const
Returns the number of bytes that should be written if one of the Write() members is called...
CountryCode FindByCode(const std::string &code) const
Finds a country code by 2 or 3 letter code.
bool ReadJson(const std::string &fileName)
Reads the country codes from a JSON file.
Dwm::CountryCode class definition.
Encapsulates a set of country codes.
Definition: DwmCountryCodes.hh:59
bool WriteJson(const std::string &fileName) const
Writes the country code to a file in JSON format.
bool operator==(const CountryCodes &countryCodes) const
operator ==
Definition: DwmCountryCodes.hh:131
CountryCodes()=default
Default constructor.
std::istream & Read(std::istream &is)
Reads the country codes from an istream. Returns the istream.
std::ostream & Write(std::ostream &os) const
Writes the country codes to an ostream. Returns the ostream.