1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef LIGHTAPP_DRIVER_H
20 #define LIGHTAPP_DRIVER_H
29 #pragma warning( disable:4251 )
32 /*!Description : Driver can save to file and read from file list of files for light modules*/
34 class LIGHTAPP_EXPORT LightApp_Driver
38 virtual ~LightApp_Driver();
41 typedef std::vector<std::string> ListOfFiles;
43 virtual bool SaveDatasInFile (const char* theFileName, bool isMultiFile);
44 virtual bool ReadDatasFromFile (const char* theFileName, bool isMultiFile);
45 virtual std::string GetTmpDir (const char* theURL, const bool isMultiFile);
47 ListOfFiles GetListOfFiles (const char* theModuleName);
48 virtual void SetListOfFiles (const char* theModuleName, const ListOfFiles theListOfFiles);
49 virtual void RemoveTemporaryFiles(const char* theModuleName, const bool IsDirDeleted);
50 void RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted);
52 virtual void ClearDriverContents();
55 void PutFilesToStream(const std::string& theModuleName, unsigned char*& theBuffer,
56 long& theBufferSize, bool theNamesOnly = false);
57 ListOfFiles PutStreamToFiles(const unsigned char* theBuffer,
58 const long theBufferSize, bool theNamesOnly = false);
60 std::string GetTmpDir();
61 std::string GetDirFromPath(const std::string& thePath);
63 void SetIsTemporary( bool theFlag ) { myIsTemp = theFlag; }
64 bool IsTemporary() const { return myIsTemp; }
67 typedef std::map<std::string, ListOfFiles> MapOfListOfFiles;
68 MapOfListOfFiles myMap;