X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSelector%2FSelector_Container.cpp;h=e37c7fd7aabc8cffe253a9322380b9b3cdcab6d9;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=8b5c537ed33924c9416dddb19f8a750211bb5b0e;hpb=52b0fdb3bbe3b4ca84519c9dd752f89a73bf6c05;p=modules%2Fshaper.git diff --git a/src/Selector/Selector_Container.cpp b/src/Selector/Selector_Container.cpp index 8b5c537ed..e37c7fd7a 100644 --- a/src/Selector/Selector_Container.cpp +++ b/src/Selector/Selector_Container.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// Copyright (C) 2014-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -79,26 +79,26 @@ bool Selector_Container::restore() return true; } -TDF_Label Selector_Container::restoreByName(std::string theName, +TDF_Label Selector_Container::restoreByName(std::wstring theName, const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator) { myShapeType = theShapeType; TDF_Label aContext; - for(size_t aStart = 0; aStart != std::string::npos; aStart = theName.find('[', aStart + 1)) { - size_t anEndPos = theName.find(']', aStart + 1); - if (anEndPos != std::string::npos) { + for(size_t aStart = 0; aStart != std::wstring::npos; aStart = theName.find('[', aStart + 1)) { + size_t anEndPos = theName.find(L']', aStart + 1); + if (anEndPos != std::wstring::npos) { // there could be sub-intersections, so, [[...]] case; searching for other open-bracket - size_t aNextStart = theName.find('[', aStart + 1); - while(aNextStart != std::string::npos && aNextStart < anEndPos) { - anEndPos = theName.find(']', anEndPos + 1); - if (anEndPos == std::string::npos) { + size_t aNextStart = theName.find(L'[', aStart + 1); + while(aNextStart != std::wstring::npos && aNextStart < anEndPos) { + anEndPos = theName.find(L']', anEndPos + 1); + if (anEndPos == std::wstring::npos) { return TDF_Label(); // invalid parentheses } - aNextStart = theName.find('[', aNextStart + 1); + aNextStart = theName.find(L'[', aNextStart + 1); } - if (anEndPos == std::string::npos) + if (anEndPos == std::wstring::npos) return TDF_Label(); // invalid parentheses - std::string aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1); + std::wstring aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1); TopAbs_ShapeEnum aSubShapeType = TopAbs_FACE; switch (myShapeType) { case TopAbs_COMPSOLID: aSubShapeType = TopAbs_SOLID; break; @@ -178,9 +178,9 @@ bool Selector_Container::solve(const TopoDS_Shape& theContext) return false; } -std::string Selector_Container::name(Selector_NameGenerator* theNameGenerator) +std::wstring Selector_Container::name(Selector_NameGenerator* theNameGenerator) { - std::string aResult; + std::wstring aResult; // add names of sub-components one by one in "[]" std::list::const_iterator aSubSel = list().cbegin(); for(; aSubSel != list().cend(); aSubSel++) {