Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for the issue #1766 : treat face as equal with different orientation to find...
[modules/shaper.git]
/
src
/
ExchangePlugin
/
ExchangePlugin_Validators.cpp
diff --git
a/src/ExchangePlugin/ExchangePlugin_Validators.cpp
b/src/ExchangePlugin/ExchangePlugin_Validators.cpp
index d13b2c478248d939d940492b18b45ae6a1f08dc1..a0117d84ef3131ef50cdd11088287c60c8fb31cc 100644
(file)
--- a/
src/ExchangePlugin/ExchangePlugin_Validators.cpp
+++ b/
src/ExchangePlugin/ExchangePlugin_Validators.cpp
@@
-8,6
+8,8
@@
#include <ExchangePlugin_Tools.h>
#include <ExchangePlugin_Tools.h>
+#include <Events_InfoMessage.h>
+
#include <ModelAPI_Feature.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Object.h>
#include <ModelAPI_Session.h>
@@
-24,7
+26,7
@@
bool ExchangePlugin_FormatValidator::parseFormats(const std::list<std::string>&
bool result = true;
for (; it != theArguments.end(); ++it) {
std::string anArg = *it;
bool result = true;
for (; it != theArguments.end(); ++it) {
std::string anArg = *it;
-
in
t aSepPos = anArg.find(":");
+
size_
t aSepPos = anArg.find(":");
if (aSepPos == std::string::npos) {
result = false;
continue;
if (aSepPos == std::string::npos) {
result = false;
continue;
@@
-39,19
+41,25
@@
bool ExchangePlugin_FormatValidator::parseFormats(const std::list<std::string>&
bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
const std::list<std::string>& theArguments,
-
std::string
& theError) const
+
Events_InfoMessage
& theError) const
{
{
- if (!theAttribute->isInitialized())
+ if (!theAttribute->isInitialized()) {
+ theError = "Is not initialized.";
return false;
return false;
+ }
const AttributeStringPtr aStrAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
const AttributeStringPtr aStrAttr =
std::dynamic_pointer_cast<ModelAPI_AttributeString>(theAttribute);
- if (!aStrAttr)
+ if (!aStrAttr) {
+ theError = "Is not a string attribute.";
return false;
return false;
+ }
std::string aFileName = aStrAttr->value();
std::string aFileName = aStrAttr->value();
- if (aFileName.empty())
+ if (aFileName.empty()) {
+ theError = "File name is empty.";
return false;
return false;
+ }
std::list<std::string> aFormats;
ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats);
std::list<std::string> aFormats;
ExchangePlugin_FormatValidator::parseFormats(theArguments, aFormats);
@@
-67,5
+75,6
@@
bool ExchangePlugin_FormatValidator::isValid(const AttributePtr& theAttribute,
}
}
}
}
}
}
+ theError = "File name does not end with any available format.";
return false;
}
return false;
}