Esempio n. 1
0
/// The optional version of the latitude conversion.
/// @see correct_hemisphere
utils::optional<geo::latitude> correct_hemisphere(
	const utils::optional<geo::latitude> & v, const utils::optional<direction> & d)
{
	if (v && d)
		return correct_hemisphere(v.value(), d.value());
	return v;
}
Esempio n. 2
0
Utils::optional<DocumentUri> DocumentLink::target() const
{
    Utils::optional<QString> optionalTarget = optionalValue<QString>(targetKey);
    return optionalTarget.has_value()
            ? Utils::make_optional(DocumentUri::fromProtocol(optionalTarget.value()))
            : Utils::nullopt;
}
Esempio n. 3
0
/// Convinience function to check status. Check takes place only if
/// the value is set.
///
/// @param[in] value The value to check.
/// @param[in] name Optional name, will be included in the exception if the check fails.
/// @exception std::invalid_argument The specified value was invalid.
void check_status(const utils::optional<status> & value, const char * name)
{
	if (value)
		check_status(value.value(), name);
}
Esempio n. 4
0
void message_21::set_latitude(const utils::optional<geo::latitude> & t)
{
	latitude_minutes = t
		? to_latitude_minutes(t.value(), latitude_minutes.count, angle_scale::I4)
		: latitude_not_available;
}