Salome HOME
Merge from V5_1_3_BR 07/12/2009
[modules/kernel.git] / src / Basics / Basics_DirUtils.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME Utils : general SALOME's definitions and tools
23 //  File   : Basics_DirUtils.hxx
24 //  Autor  : Alexander A. BORODIN
25 //  Module : SALOME
26 //
27 #ifndef _Basics_DIRUTILS_HXX_
28 #define _Basics_DIRUTILS_HXX_
29
30 #include "SALOME_Basics.hxx"
31
32 #include <string>
33
34 namespace Kernel_Utils
35 {
36   // Extracts and returns the base name of the specified file name.
37   BASICS_EXPORT std::string GetBaseName( const std::string& file_path );
38
39   // Returns the unique temporary directory, that is defined in tmp_path_env if this variable is set
40   // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
41   BASICS_EXPORT std::string GetTmpDirByEnv( const std::string& tmp_path_env );
42
43   // Returns the unique temporary directory, that is defined in tmp_path if this variable is set
44   // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
45   BASICS_EXPORT std::string GetTmpDirByPath( const std::string& tmp_path );
46   
47   // Returns the unique temporary directory in 
48   // /tmp/something/ for Unix or c:\something\ for WIN32
49   BASICS_EXPORT std::string GetTmpDir();
50
51
52   // Returns the unique temporary file name without any extension
53   // /tmp/something/file for Unix or c:\something\file for WIN32
54   BASICS_EXPORT std::string GetTmpFileName();
55
56   // Returns True(False) if the path (not)exists
57   BASICS_EXPORT bool IsExists( const std::string& path );
58
59   // Returns directory by path and converts it to native system format
60   BASICS_EXPORT std::string GetDirByPath( const std::string& path );
61
62   // Returns True(False) if the path (not) empty
63   // Also returns False if the path is not valid
64   BASICS_EXPORT bool IsEmptyDir( const std::string& path );
65 }
66
67 #endif