X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHEXABLOCK%2Fhexa_utils.cxx;h=5e133d378d5c9c4fef31af47b15a4d717e855110;hb=76a04c833d6dbc5affe2455f372fb625050f5746;hp=76a039ebaad20ca237c5fa918b1fae96404fbf93;hpb=ab53385205fe062af0e87d4e14296b1492fe3611;p=modules%2Fhexablock.git diff --git a/src/HEXABLOCK/hexa_utils.cxx b/src/HEXABLOCK/hexa_utils.cxx old mode 100755 new mode 100644 index 76a039e..5e133d3 --- a/src/HEXABLOCK/hexa_utils.cxx +++ b/src/HEXABLOCK/hexa_utils.cxx @@ -1,12 +1,12 @@ // C++ : Fonctions utilitaires de Hexa -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2019 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. +// 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 @@ -25,6 +25,7 @@ #include #include #include +#include #include BEGIN_NAMESPACE_HEXA @@ -63,7 +64,7 @@ bool in_test () } // ======================================================== set_minus -void set_minus (string& chaine) +void set_minus (std::string& chaine) { int lg = chaine.size(); for (int nc=0 ; nc=0 ; --nc) + { + char car = filename[nc]; + if (car==slash || car==antis) + { + if (ifin >0) + { + ideb = nc + 1; + more = false; + } + } + else if (ifin<0) + ifin = nc; + } + + if (ifin <0) + { + base = "undefined"; + return HERR; + } + + base = ""; + for (int nc=ideb ; nc <= ifin ; ++nc) + base += filename[nc]; + return HOK; +} END_NAMESPACE_HEXA