mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #288, improved validation in some value objects
This commit is contained in:
committed by
Roland Winklmeier
parent
5ff28cb3a1
commit
d1d02d6c3c
@@ -38,6 +38,17 @@ namespace BlackMisc
|
||||
return this->m_user.hasValidCredentials() && this->m_port > 0 && !this->m_address.isEmpty() && this->isAcceptingConnections();
|
||||
}
|
||||
|
||||
CStatusMessageList CServer::validate() const
|
||||
{
|
||||
CStatusMessageList msgs;
|
||||
if (this->getName().isEmpty()) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityWarning, "Missing name")); }
|
||||
if (this->getAddress().isEmpty()) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityWarning, "Missing address")); }
|
||||
if (this->getDescription().isEmpty()) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityWarning, "Missing description")); }
|
||||
if (this->getPort() < 1 || this->getPort() > 65535) { msgs.push_back(CStatusMessage(CStatusMessage::SeverityWarning, "Wrong port")); }
|
||||
msgs.push_back(this->getUser().validate());
|
||||
return msgs;
|
||||
}
|
||||
|
||||
/*
|
||||
* Property by index
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user