#include <ViewerTest_CmdParser.hxx>
#include <Draw.hxx>
+#include <Message.hxx>
#include <ViewerTest.hxx>
#include <algorithm>
}
else
{
- std::cerr << "Error: unknown argument '" << anOptionName << "'\n";
+ Message::SendFail() << "Error: unknown argument '" << anOptionName << "'";
return;
}
}
const bool aResult = (anOptionArguments.size() >= theMandatoryArgsNb);
if (isFatal && !aResult)
{
- std::cerr << "Error: wrong syntax at option '" << myOptionStorage[theOptionKey].Name << "'\n"
- << "At least " << theMandatoryArgsNb << "expected, but only " << anOptionArguments.size()
- << "provided.\n";
+ Message::SendFail() << "Error: wrong syntax at option '" << myOptionStorage[theOptionKey].Name << "'\n"
+ << "At least " << theMandatoryArgsNb << "expected, but only " << anOptionArguments.size()
+ << "provided.";
}
return aResult;
}
std::string& theOptionArgument) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
false);
ViewerTest_CommandOptionKey anOptionKey = THE_UNNAMED_COMMAND_OPTION_KEY;
if (!theOptionName.empty() && !findOptionKey (theOptionName, anOptionKey))
std::string& theOptionArgument) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
false);
std::size_t aUsedOptionIndex = 0;
if (!findUsedOptionIndex (theOptionKey, aUsedOptionIndex))
std::string ViewerTest_CmdParser::Arg (const std::string& theOptionName, const Standard_Integer theArgumentIndex) const
{
Standard_ASSERT_RETURN (theArgumentIndex >= 0,
- __FUNCTION__ ": 'theArgumentIndex' must be greater than or equal to zero.",
+ "'theArgumentIndex' must be greater than or equal to zero.",
std::string());
std::string anOptionArgument;
if (!Arg (theOptionName, theArgumentIndex, anOptionArgument))
const RawStringArguments aRawStringArguments = getRawStringArguments (aUsedOptionIndex);
const Standard_Integer aNumberOfArguments = static_cast<Standard_Integer> (aRawStringArguments.size());
Standard_ASSERT_RETURN (theArgumentIndex < aNumberOfArguments,
- __FUNCTION__ ": 'theArgumentIndex' must be less than the number of command-line arguments "
- "passed with the option which access key is 'theOptionKey'.",
+ "'theArgumentIndex' must be less than the number of command-line arguments "
+ "passed with the option which access key is 'theOptionKey'.",
false);
const Standard_Integer aNumberOfAvailableArguments = aNumberOfArguments - theArgumentIndex;
TheColor aColor;
{
Standard_ASSERT_RETURN (
theUsedOptionIndex < myOptionArgumentStorage.size(),
- __FUNCTION__ ": 'theUsedOptionIndex' must be less than the size of 'myOptionArgumentStorage'.",
+ "'theUsedOptionIndex' must be less than the size of 'myOptionArgumentStorage'.",
RawStringArguments());
const OptionArguments& anOptionArguments = myOptionArgumentStorage[theUsedOptionIndex];
return convertToRawStringList (anOptionArguments);