Debian Codegraph @

src/3rdParty/salomesmesh/inc/SALOMEDS_Tool.hxx

raw symbols SCIP
1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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 : [email protected]
21 //
22
23 // File : SALOMEDS_Tool.hxx
24 // Created : Mon Oct 21 16:24:50 2002
25 // Author : Sergey RUIN
26 // Project : SALOME
27 // Module : SALOMEDS
28 //
29 #ifndef __SALOMEDS_Tool_H__
30 #define __SALOMEDS_Tool_H__
31
32 #include <string>
33 #include <list>
34 #include <SALOMEDS.hxx>
35
36 // IDL headers
37
38 #ifdef WIN32
39 # if defined TOOLSDS_EXPORTS
40 # define TOOLSDS_EXPORT __declspec( dllexport )
41 # else
42 # define TOOLSDS_EXPORT __declspec( dllimport )
43 # endif
44 #else
45 # define TOOLSDS_EXPORT
46 #endif
47
48 class TOOLSDS_EXPORT SALOMEDS_Tool
49 {
50 public:
51
52 // Returns the unique temporary directory, that is defined in SALOME_TMP_DIR if this variable is set
53 // otherwise return /tmp/something/ for Unix or c:\something\ for WIN32
54 static std::string GetTmpDir();
55
56
57 // Removes files which are in <theDirectory>, the files for deletion are listed in <theFiles>
58 // if <IsDirDeleted> is true <theDirectory> is also deleted if it is empty
59 static void RemoveTemporaryFiles(const std::string& theDirectory,
60 const SALOMEDS::ListOfFileNames& theFiles,
61 const bool IsDirDeleted);
62
63 // Converts files listed in <theFiles> which are in <theFromDirectory> into a byte sequence TMPFile
64 static SALOMEDS::TMPFile* PutFilesToStream(const std::string& theFromDirectory,
65 const SALOMEDS::ListOfFileNames& theFiles,
66 const int theNamesOnly = 0);
67
68 // Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
69 static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
70 const SALOMEDS::ListOfFileNames& theFileNames);
71
72 // Converts a byte sequence <theStream> to files and places them in <theToDirectory>
73 static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
74 const std::string& theToDirectory,
75 const int theNamesOnly = 0);
76
77 // Returns the name by the path
78 // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "doc1"
79 static std::string GetNameFromPath(const std::string& thePath);
80
81 // Returns the directory by the path
82 // for an example: if thePath = "/tmp/aaa/doc1.hdf" the function returns "/tmp/aaa"
83 static std::string GetDirFromPath(const std::string& thePath);
84
85 // Retrieves specified flaf from "AttributeFlags" attribute
86 static bool GetFlag( const int theFlag,
87 SALOMEDS::Study_var theStudy,
88 SALOMEDS::SObject_var theObj );
89
90 // Sets/Unsets specified flaf from "AttributeFlags" attribute
91 static bool SetFlag( const int theFlag,
92 SALOMEDS::Study_var theStudy,
93 const std::string& theEntry,
94 const bool theValue );
95
96 // Get all children of object. If theObj is null all objects of study are returned
97 static void GetAllChildren( SALOMEDS::Study_var theStudy,
98 SALOMEDS::SObject_var theObj,
99 std::list<SALOMEDS::SObject_var>& theList );
100
101 };
102 #endif
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122