X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FInitializationPlugin%2FInitializationPlugin_PyInterp.h;h=163c265b22cf41fb649774061d928402b6f59bc0;hb=4e318f7539c90724e703e14e4999e35d7c2941bc;hp=5e4b671633c861f48cd1bb57f150cb378541b025;hpb=332f6b9a2a68158cf49feab94e21dd384d144b37;p=modules%2Fshaper.git diff --git a/src/InitializationPlugin/InitializationPlugin_PyInterp.h b/src/InitializationPlugin/InitializationPlugin_PyInterp.h index 5e4b67163..163c265b2 100644 --- a/src/InitializationPlugin/InitializationPlugin_PyInterp.h +++ b/src/InitializationPlugin/InitializationPlugin_PyInterp.h @@ -1,10 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> -/* - * InitializationPlugin_PyInterp.h - * - * Created on: Apr 2, 2015 - * Author: sbh - */ +// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef INITIALIZATIONPLUGIN_PYINTERP_H_ #define INITIALIZATIONPLUGIN_PYINTERP_H_ @@ -28,16 +39,19 @@ class INITIALIZATIONPLUGIN_EXPORT InitializationPlugin_PyInterp : public PyInter virtual ~InitializationPlugin_PyInterp(); /// Returns a list of positions for theName in theExpression. - std::list > positions(const std::string& theExpression, - const std::string& theName); + std::list > positions(const std::wstring& theExpression, + const std::wstring& theName); /// Compiles theExpression and returns a list of parameters used in theExpression. - std::list compile(const std::string& theExpression); + std::list compile(const std::wstring& theExpression); /// Extends local context with the list of parameters. - void extendLocalContext(const std::list& theParameters); + void extendLocalContext(const std::list& theParameters); /// Clears local context. void clearLocalContext(); /// Evaluates theExpression and returns its value. - double evaluate(const std::string& theExpression, std::string& theError); + double evaluate(const std::wstring& theExpression, std::string& theError); + + /// Runs the string command in the python interpreter. Returns true if no error is in result. + bool runString(std::string theString); protected: /// Returns error message.