\return Variable usage.
*/
boolean IsVariableUsed( in string theVarName );
+
+/*! \brief Parse variables used for object creation
+
+ \param string with variables, separated by special symbol.
+ \return Variables list.
+*/
+ ListOfStrings ParseVariables( in string theVars );
+
};
//==========================================================================
return aResult;
}
+vector<string> SALOMEDS_Study::ParseVariables(const string& theVars)
+{
+ vector<string> aResult;
+ if (_isLocal) {
+ SALOMEDS::Locker lock;
+ aResult = _local_impl->ParseVariables(theVars);
+ }
+ else {
+ SALOMEDS::ListOfStrings_var aSeq = _corba_impl->ParseVariables(theVars.c_str());
+ int aLength = aSeq->length();
+ for (int i = 0; i < aLength; i++)
+ aResult.push_back( string(aSeq[i].in()) );
+ }
+ return aResult;
+}
+
std::string SALOMEDS_Study::ConvertObjectToIOR(CORBA::Object_ptr theObject)
{
return _orb->object_to_string(theObject);
virtual bool RemoveVariable(const std::string& theVarName);
virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
virtual bool IsVariableUsed(const std::string& theVarName);
+ virtual std::vector<std::string> ParseVariables(const std::string& theVars);
std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
return _impl->IsVariableUsed(string(theVarName));
}
+
+//============================================================================
+/*! Function : ParseVariables
+ * Purpose :
+ */
+//============================================================================
+SALOMEDS::ListOfStrings* SALOMEDS_Study_i::ParseVariables(const char* theVarName)
+{
+ vector<string> aVarNames = _impl->ParseVariables(string(theVarName));
+ SALOMEDS::ListOfStrings_var aResult = new SALOMEDS::ListOfStrings;
+
+ int aLen = aVarNames.size();
+ aResult->length(aLen);
+
+ for (int anInd = 0; anInd < aLen; anInd++)
+ aResult[anInd] = CORBA::string_dup(aVarNames[anInd].c_str());
+
+ return aResult._retn();
+}
+
//============================================================================
/*! Function : GetDefaultScript
* Purpose :
virtual CORBA::Boolean RenameVariable(const char* theVarName, const char* theNewVarName);
virtual CORBA::Boolean IsVariableUsed(const char* theVarName);
+
+ virtual SALOMEDS::ListOfStrings* ParseVariables(const char* theVars);
virtual char* GetDefaultScript(const char* theModuleName, const char* theShift);
virtual bool RenameVariable(const std::string& theVarName,
const std::string& theNewVarName) = 0;
virtual bool IsVariableUsed(const std::string& theVarName) = 0;
+
+ virtual std::vector<std::string> ParseVariables(const std::string& theVars) = 0;
};
}
}
+//============================================================================
+/*! Function : EnableUseCaseAutoFilling
+ * Purpose :
+ */
+//============================================================================
+vector<string> SALOMEDSImpl_Study::ParseVariables(const string& theVariables) const
+{
+ return SALOMEDSImpl_Tool::splitStringWithEmpty( theVariables, VARIABLE_SEPARATOR );
+}
+
//============================================================================
/*! Function : EnableUseCaseAutoFilling
* Purpose :
const std::string& theDest);
void ReplaceVariableAttribute(const std::string& theSource, const std::string& theDest);
+ std::vector<std::string> ParseVariables(const std::string& theVariables) const;
+
//Returns a callback
SALOMEDSImpl_Callback* GetCallback() { return _cb; }