X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_Validators.cpp;h=e0579464007a69089e5e9578d58dfcb40bb747bb;hb=514bc3ce714fa4b398b94f3293aa279b31725467;hp=052140b8136f963bfb02118b346d0a8a06e4de56;hpb=1a0d48211014d96db9125fe973eacbae895c4490;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_Validators.cpp b/src/ExchangePlugin/ExchangePlugin_Validators.cpp index 052140b81..e05794640 100644 --- a/src/ExchangePlugin/ExchangePlugin_Validators.cpp +++ b/src/ExchangePlugin/ExchangePlugin_Validators.cpp @@ -38,19 +38,26 @@ bool ExchangePlugin_FormatValidator::parseFormats(const std::list& } bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute, - const std::list& theArguments) const + const std::list& theArguments, + std::string& theError) const { - if (!theAttribute->isInitialized()) + if (!theAttribute->isInitialized()) { + theError = "Is not initialized."; return false; + } const AttributeStringPtr aStrAttr = std::dynamic_pointer_cast(theAttribute); - if (!aStrAttr) + if (!aStrAttr) { + theError = "Is not a string attribute."; return false; + } std::string aFileName = aStrAttr->value(); - if (aFileName.empty()) + if (aFileName.empty()) { + theError = "File name is empty."; return false; + } std::list aFormats; ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats); @@ -66,5 +73,6 @@ bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute, } } } + theError = "File name does not end with any available format."; return false; }