-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 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
#include <QFileInfo>
#include <QDir>
+#include <Qtx.h>
+
#ifdef WIN32
#include <time.h>
#endif
+using namespace std;
+
/*! Constructor.*/
LightApp_Driver::LightApp_Driver()
: myIsTemp( false )
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;
}