Salome HOME
updated copyright message
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_Tool.hxx
index 4c7433891a9731d77644659088ce778a8fba45fa..b73c16c73bdfa3c6e4820c200acea62436381a43 100644 (file)
@@ -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 <TCollection_AsciiString.hxx>
-#include <TDF_Label.hxx>
-#include <TColStd_HSequenceOfAsciiString.hxx>
+#include "SALOMEDSImpl_Defines.hxx"
+
+#include <string>
+#include <vector>
+#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 <theDirectory>, the files for deletion are listed in <theFiles>
   // if <IsDirDeleted> is true <theDirectory> 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<std::string>& 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<std::string> 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<std::string> 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<std::string> > 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