3#include "boost/algorithm/string.hpp"
15 zid::zid(
const zid& x) :
aid(x.
aid),regions(x.regions),country(x.country),zone(x.zone),zone_type(x.zone_type)
18 zid::zid(
zid&& x) :
aid(std::move(x.
aid)),regions(std::move(x.regions)),country(std::move(x.country)),zone(std::move(x.zone)),zone_type(std::move(x.zone_type))
51 boost::split(values,
init_zid,boost::is_any_of(
":"));
56 if (values[0][3] !=
' ')
115 aid = std::move(x.aid);
116 regions = std::move(x.regions);
117 country = std::move(x.country);
118 zone = std::move(x.zone);
131 return (
country ==
"no-country");
136 return (
country ==
"unknown-country");
192 boost::split(values,
init_zid,boost::is_any_of(
":"));
197 if (values[0][3] !=
' ')
229 zone = values.back();
245 if (values[0][3] !=
' ')
277 zone = values.back();
342 for (
unsigned int i = 0; i < x.
regions.size(); i++)
382 return !(x == init_zid_full);
393 return !(init_zid_full == x);
398 ostringstream output;
405 ostringstream output;
413 ostringstream output;
421 return os << to_string(x);
Class that stores astronomical ids, not as an integer but with an string as identifier....
Class that allows to store information about a zone, including the astronomical object inside which t...
zid::type zone_type
The type of zone. It can be any value of the enum zid::type. The possible values are COUNTRY,...
bool has_unknown_country() const
Returns true if the value of country is the predefined value 'unknown-country'.
void initialize_from_string(const string &init_zid_full)
Internal function. It's used by the string constructor and the string assignment of zid to initialize...
string display() const
Returns a string representation of zid, including the string representation of his aid.
bool has_no_country() const
Returns true if the value of country is the predefined value 'no-country'.
string partial_display() const
Returns a string representation of zid, without the string representation of his aid.
zid & operator=(const zid &x)
Copy assigment. The member-variables are copied from the zid x.
scifir::aid aid
The aid of the astronomical object where the zone is.
zid()
Default constructor. There's no data about any zone, the aid member-variable is also empty.
vector< string > regions
The different administrative regions where the zone is. There can be any number of administrative reg...
string zone
The name of the zone. Personal zones with a personal name are allowed, it's not necessary that the zo...
@ ZONE
A zone. A zone is any surface inside an astronomical object, of any shape. It's not necessary to be a...
@ SETTLEMENT
A settlement.
string country
The country where the zone is. In extraterrestrial planets, it's considered a country any division of...
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
@ NONE
No predefined astronomical body selected.
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
zid::type create_zone_type(const string &zone_type_abbreviation)
Creates an instance of a zid::type with the given string, which is the reverse as the to_string() fun...
bool operator==(const scifir::zid &x, const scifir::zid &y)
Returns true if the type and all data are the same between x and y.
istream & operator>>(istream &is, scifir::zid &x)
Allows that an istream initializes by string a zid x.
ostream & operator<<(ostream &os, const scifir::zid &x)
Adds the string representation of the zid x to an output stream os.
void operator+=(string &x, const scifir::zid &y)
Concatenates the string representation of zid y to the string x.
string operator+(const string &x, const scifir::zid &y)
Concatenates x with the string representation of zid y.
bool operator!=(const scifir::zid &x, const scifir::zid &y)
Returns true if the type or any data is different between x and y.