1 // Copyright (C) 2014-2023 CEA, EDF
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "ModelAPI_Expression.h"
22 #include <Locale_Convert.h>
26 ModelAPI_Expression::ModelAPI_Expression()
31 ModelAPI_Expression::~ModelAPI_Expression()
36 bool ModelAPI_Expression::isInitialized()
38 return myIsInitialized;
41 void ModelAPI_Expression::setInitialized()
43 myIsInitialized = true;
46 ModelAPI_ExpressionDouble::ModelAPI_ExpressionDouble()
51 ModelAPI_ExpressionInteger::ModelAPI_ExpressionInteger()
57 bool ModelAPI_Expression::isVariable(const std::string& theString)
59 return isVariable(Locale::Convert::toWString(theString));
62 bool ModelAPI_Expression::isVariable(const std::wstring& theString)
64 if (theString.empty())
67 std::wstring::const_iterator it = theString.begin();
68 if (!(iswalpha(*it) || (*it) == L'_') || it == theString.end())
71 for ( ; it != theString.end(); ++it ) {
72 if(!(iswalnum(*it) || (*it) == L'_')) {