Added with() and withValidation() methods in CLogCategoryList.

This commit is contained in:
Mat Sutcliffe
2019-03-02 18:23:52 +00:00
parent 1cb21f0a4b
commit a366ad8943
15 changed files with 30 additions and 21 deletions

View File

@@ -781,7 +781,7 @@ namespace BlackMisc
CStatusMessageList CAircraftModel::validate(bool withNestedObjects) const
{
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation() }));
static const CLogCategoryList cats(CLogCategoryList(this).withValidation());
CStatusMessageList msgs;
if (!hasModelString()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Model: missing model string (aka key)")); }
if (!hasValidSimulator()) {msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Model: no simulator set")); }

View File

@@ -132,7 +132,7 @@ namespace BlackMisc
CStatusMessageList CDistributor::validate() const
{
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::validation() }));
static const CLogCategoryList cats(CLogCategoryList(this).withValidation());
CStatusMessageList msgs;
if (!hasValidDbKey()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Distributor: missing id")); }
if (!hasDescription()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Distributor: missing description")); }