Encapsulates a set of country codes. More...
#include <DwmCountryCodes.hh>
Inherits Readable, and Writable.
Public Member Functions | |
| CountryCodes ()=default | |
| Default constructor. | |
| CountryCode | FindByCode (const std::string &code) const |
| Finds a country code by 2 or 3 letter code. More... | |
| std::vector< CountryCode > | FindByNameRegExp (const std::string &rgxp) const |
| bool | ReadJson (const std::string &fileName) |
| Reads the country codes from a JSON file. More... | |
| bool | WriteJson (const std::string &fileName) const |
| Writes the country code to a file in JSON format. More... | |
| std::istream & | Read (std::istream &is) |
| Reads the country codes from an istream. Returns the istream. | |
| ssize_t | Read (int fd) |
| Reads the country codes from a descriptor. More... | |
| size_t | Read (FILE *f) |
| Reads the country codes from a FILE. More... | |
| std::ostream & | Write (std::ostream &os) const |
| Writes the country codes to an ostream. Returns the ostream. | |
| ssize_t | Write (int fd) const |
| Writes the country codes to a file descriptor. More... | |
| size_t | Write (FILE *f) const |
| Writes the country codes to a FILE. More... | |
| uint32_t | StreamedLength () const |
| Returns the number of bytes that should be written if one of the Write() members is called. More... | |
| bool | operator== (const CountryCodes &countryCodes) const |
| operator == | |
Encapsulates a set of country codes.
| CountryCode Dwm::CountryCodes::FindByCode | ( | const std::string & | code | ) | const |
Finds a country code by 2 or 3 letter code.
Returns a filled CountryCode on success, an empty CountryCode on failure.
| ssize_t Dwm::CountryCodes::Read | ( | int | fd | ) |
Reads the country codes from a descriptor.
Returns the number of bytes read on success, -1 on failure.
| size_t Dwm::CountryCodes::Read | ( | FILE * | f | ) |
Reads the country codes from a FILE.
Returns 1 on success, 0 on failure (fread() semantics).
| bool Dwm::CountryCodes::ReadJson | ( | const std::string & | fileName | ) |
Reads the country codes from a JSON file.
Returns true on success, false on failure.
| uint32_t Dwm::CountryCodes::StreamedLength | ( | ) | const |
Returns the number of bytes that should be written if one of the Write() members is called.
| ssize_t Dwm::CountryCodes::Write | ( | int | fd | ) | const |
Writes the country codes to a file descriptor.
Returns the number of bytes written on success, -1 on failure.
| size_t Dwm::CountryCodes::Write | ( | FILE * | f | ) | const |
Writes the country codes to a FILE.
Returns 1 on success, 0 on failure (fwrite() semantics).
| bool Dwm::CountryCodes::WriteJson | ( | const std::string & | fileName | ) | const |
Writes the country code to a file in JSON format.
Returns true on success, false on failure.