Ref T215, utility functions

* CServer
* ICAO List
This commit is contained in:
Klaus Basan
2018-01-02 02:24:15 +01:00
parent 9799fc1724
commit b68e232f38
4 changed files with 20 additions and 0 deletions

View File

@@ -152,6 +152,11 @@ namespace BlackMisc
return m_timestampMSecsSinceEpoch >= 0;
}
bool CServer::isNull() const
{
return this->hasUnspecifiedServerType() && !this->hasName() && m_port < 0;
}
CStatusMessageList CServer::validate() const
{
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation()}));

View File

@@ -101,6 +101,9 @@ namespace BlackMisc
//! Get name
const QString &getName() const { return m_name; }
//! Has name?
bool hasName() const { return !m_name.isEmpty(); }
//! Set name
void setName(const QString &name) { m_name = name.trimmed(); }
@@ -176,6 +179,9 @@ namespace BlackMisc
//! Is connected?
bool isConnected() const;
//! NULL?
bool isNull() const;
//! Validate, provide details about issues
CStatusMessageList validate() const;