-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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, 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.
+// 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
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// 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/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "LightApp_Driver.h"
#include <TCollection_AsciiString.hxx>
#include <QFileInfo>
#include <QDir>
+#include <Qtx.h>
+
#ifdef WIN32
#include <time.h>
#endif
+using namespace std;
+
/*! Constructor.*/
LightApp_Driver::LightApp_Driver()
: myIsTemp( false )
{
}
-using namespace std;
-
/*!
Save in file 'theFileName' datas from this driver
*/
for (it = myMap.begin(); it != myMap.end(); ++it) {
aModuleName[i] = const_cast<char*>(it->first.c_str());//(it->first);
aFileBufferSize += 4; //Add 4 bytes: a length of the module name
- aFileBufferSize += strlen(aModuleName[i])+1;
+ aFileBufferSize += (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int
std::string aName(aModuleName[i]);
PutFilesToStream(aName, aBuffer[i], aBufferSize[i], isMultiFile);
aFileBufferSize += 8; //Add 8 bytes: a length of the buffer
if(aFileBuffer == NULL)
return false;
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ;
int aCurrentPos = 0;
int aBufferNameSize = 0;
for (i = 0; i < n; i++) {
- aBufferNameSize = strlen(aModuleName[i])+1;
+ aBufferNameSize = (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int
//Initialize 4 bytes of the buffer by 0
memset((aFileBuffer + aCurrentPos), 0, 4);
//Copy the length of the module name to the buffer
ifstream aFile(theFileName);
#endif
- myTmpDir = QDir::convertSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toLatin1().constData() ;
+ myTmpDir = QDir::toNativeSeparators( QFileInfo( theFileName ).absolutePath() + "/" ).toUtf8().constData() ;
aFile.seekg(0, ios::end);
int aFileBufferSize = aFile.tellg();
if (myMap.count(aName))
aListOfFiles = myMap[aName];
- return aListOfFiles;
+ return aListOfFiles;
}
/*!
// aFiles must contain temporary directory name in its first item
// and names of files (relatively the temporary directory) in the others
- int i, aLength = aFiles.size() - 1;
+ int i, aLength = (int)aFiles.size() - 1; //!< TODO: conversion size_t to int
if(aLength <= 0) {
theBufferSize = 0;
theBuffer = new unsigned char[theBufferSize];
aFileSize[i] = aFile.tellg();
aBufferSize += aFileSize[i]; //Add a space to store the file
}
- aFileNameSize[i] = strlen(aFName) + 1;
+ aFileNameSize[i] = (int)strlen(aFName) + 1; //!< TODO: conversion from size_t to int
aBufferSize += aFileNameSize[i]; //Add a space to store the file name
aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name,
// 8 bytes: length of the file itself
*/
void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted)
{
- int i, aLength = theFiles.size() - 1;
+ int i, aLength = (int)theFiles.size() - 1; //!< TODO: conversion size_t to int
if(aLength <= 0) {
return;
}