X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelHighAPI%2FModelHighAPI_Integer.cpp;h=00591dc2ef4289f2bbff8a1c25e319b2b842e1e4;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=8691146f9a63d6f119048661d37b7389e8930bda;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/ModelHighAPI/ModelHighAPI_Integer.cpp b/src/ModelHighAPI/ModelHighAPI_Integer.cpp index 8691146f9..00591dc2e 100644 --- a/src/ModelHighAPI/ModelHighAPI_Integer.cpp +++ b/src/ModelHighAPI/ModelHighAPI_Integer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 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 @@ -20,6 +20,8 @@ #include "ModelHighAPI_Integer.h" #include + +#include //-------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------- @@ -29,13 +31,13 @@ ModelHighAPI_Integer::ModelHighAPI_Integer(int theValue) { } -ModelHighAPI_Integer::ModelHighAPI_Integer(const std::string & theValue) +ModelHighAPI_Integer::ModelHighAPI_Integer(const std::wstring & theValue) : myVariantType(VT_STRING) , myString(theValue) { } -ModelHighAPI_Integer::ModelHighAPI_Integer(const char * theValue) +ModelHighAPI_Integer::ModelHighAPI_Integer(const wchar_t * theValue) : myVariantType(VT_STRING) , myString(theValue) { @@ -60,3 +62,13 @@ int ModelHighAPI_Integer::intValue() const // needed for array of integer, which supports no text return myInt; } + +std::wstring ModelHighAPI_Integer::string() const +{ + if (myVariantType == VT_STRING) + return myString; + + std::wostringstream anOut; + anOut << myInt; + return anOut.str(); +}