X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDSImpl%2FSALOMEDSImpl_Tool.hxx;h=b73c16c73bdfa3c6e4820c200acea62436381a43;hb=20c132438f5b8f7337bf35272989b10eb003d71c;hp=4c7433891a9731d77644659088ce778a8fba45fa;hpb=35960e77d7f9f2a5cac7d6550c23f12943bc4378;p=modules%2Fkernel.git diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx index 4c7433891..b73c16c73 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Tool.hxx @@ -1,61 +1,87 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// // 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. -// -// 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 +// 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 +// 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/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // File : SALOMEDSImpl_Tool.hxx // Created : Mon Oct 21 16:24:50 2002 // Author : Sergey RUIN - // Project : SALOME // Module : SALOMEDSImpl -// Copyright : Open CASCADE - - +// #ifndef __SALOMEDSIMPL_TOOL_H__ #define __SALOMEDSIMPL_TOOL_H__ -#include -#include -#include +#include "SALOMEDSImpl_Defines.hxx" + +#include +#include +#include "DF_Label.hxx" + +#ifdef WIN32 +# undef GetUserName +#endif -class SALOMEDSImpl_Tool +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_Tool { public: // Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set - // otherwise return /tmp/something/ for Unix or c:\something\ for WNT - static TCollection_AsciiString GetTmpDir(); + // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32 + static std::string GetTmpDir(); // Removes files which are in , the files for deletion are listed in // if is true is also deleted if it is empty - static void RemoveTemporaryFiles(const TCollection_AsciiString& theDirectory, - const Handle(TColStd_HSequenceOfAsciiString)& theFiles, - const bool IsDirDeleted); + static void RemoveTemporaryFiles(const std::string& theDirectory, + const std::vector& theFiles, + const bool IsDirDeleted); // Returns the name by the path // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1" - static TCollection_AsciiString GetNameFromPath(const TCollection_AsciiString& thePath); + static std::string GetNameFromPath(const std::string& thePath); // Returns the directory by the path // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa" - static TCollection_AsciiString GetDirFromPath(const TCollection_AsciiString& thePath); + static std::string GetDirFromPath(const std::string& thePath); + + //The functions returns a list of substring of initial string divided by given separator + static std::vector splitString(const std::string& theValue, char separator); + + //The functions returns a list of substring of initial string divided by given separator, + //include empty strings + static std::vector splitStringWithEmpty(const std::string& theValue, char separator); + + //The functions returns a list of substring of initial string divided by given separator, + //include empty strings + static std::vector< std::vector > splitStringWithEmpty(const std::string& theValue, + char separator1, + char separator2); + + + //Returns a system date + static void GetSystemDate(int& year, int& month, int& day, int& hours, int& minutes, int& seconds); + + //Returns a name of the user + static std::string GetUserName(); }; #endif