-This is the version 3.1.0 of KERNEL
+This is the version 3.2.0a1 of KERNEL
Previous versions :
+ - 3.1.0
- 3.0.0
- 2.2.4
- 2.2.3
-THIS IS SALOME - KERNEL VERSION: 3.1.0
+THIS IS SALOME - KERNEL VERSION: 3.2.0a1
comName=`which $0`
rep=`dirname $comName`
-cp -r $rep/appliskel $1
-chmod +x $1/*.sh $1/run* $1/envd
+if [ $# -ne 1 ]
+ echo "--- usage:"
+ echo $0 AppliName
+ echo "--- In which AppliName is a directory to create with SALOME application scripts"
+elif [ -d $1]
+ echo $1 "directory already exists, nothing done"
+else
+ mkdir -p $1
+ cp -r $rep/appliskel/* $1
+ cp $rep/appliskel/.bashrc $1
+ chmod +x $1/*.sh $1/run* $1/envd
+fi
\ No newline at end of file
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME v.3.1.0"
+PROJECT_NAME = "SALOME v.3.2.0a1"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English
-foldersTree = gFld("<b>SALOME v.3.1.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.3.2.0a1 </b>", "", "")
insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
<machine hostname="is111790" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
</machine>
<machine hostname="is111915" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
</machine>
<machine hostname="is111918" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
</machine>
<machine hostname="is111996" OS="LINUX" CPUFreqMHz="2992" memInMB="1024" protocol="r" mode="i" nbOfNodes="1" nbOfProcPerNode="1" preReqFilePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL/salome.sh" >
<modules modulePath="/home/secher/SALOME2_INSTALL/KERNEL_INSTALL" moduleName="KERNEL" />
-<modules modulePath="/export/home/LGLS/Products/MED_3.1.0" moduleName="MED" />
-<modules modulePath="/export/home/LGLS/Products/GEOM_3.1.0" moduleName="GEOM" />
-<modules modulePath="/export/home/LGLS/Products/SMESH_3.1.0" moduleName="SMESH" />
-<modules modulePath="/export/home/LGLS/Products/SUPERV_3.1.0" moduleName="SUPERV" />
-<modules modulePath="/export/home/LGLS/Products/VISU_3.1.0" moduleName="VISU" />
+<modules modulePath="/export/home/LGLS/Products/MED_3.2.0a1" moduleName="MED" />
+<modules modulePath="/export/home/LGLS/Products/GEOM_3.2.0a1" moduleName="GEOM" />
+<modules modulePath="/export/home/LGLS/Products/SMESH_3.2.0a1" moduleName="SMESH" />
+<modules modulePath="/export/home/LGLS/Products/SUPERV_3.2.0a1" moduleName="SUPERV" />
+<modules modulePath="/export/home/LGLS/Products/VISU_3.2.0a1" moduleName="VISU" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYCOMPO_INSTALL" moduleName="MYCOMPO" />
<modules modulePath="/home/secher/SALOME2_INSTALL/MYMPICOMPO_INSTALL" moduleName="MYMPICOMPO" />
</machine>
<component-username>Salome</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>3.1.0</component-version>
+ <component-version>3.2.0a1</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<component-username>SalomeTestComponent</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>3.1.0</component-version>
+ <component-version>3.2.0a1</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
<component-username>SALOME_TestComponentPy</component-username>
<component-type>Other</component-type>
<component-author>NRI</component-author>
- <component-version>3.1.0</component-version>
+ <component-version>3.2.0a1</component-version>
<component-comment>GUI Neutral Context</component-comment>
<component-multistudy>1</component-multistudy>
<constraint>'linux' ~ OS</constraint>
AC_SUBST(BOOST_LIBS)
BOOST_LIBS=""
+AC_SUBST(BOOST_LIBTHREAD)
+BOOST_LIBTHREAD=""
+
boost_ok=no
if test -z ${BOOSTDIR}; then
AC_CHECKING(for libboost_thread-mt.so library file)
AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread-mt.so,boost_ok=yes,boost_ok=no)
if test "x${boost_ok}" = "xyes" ; then
- BOOST_LIBS="-L${BOOSTDIR}/lib"
+ BOOST_LIBTHREAD="libboost_thread-mt.so"
+ AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+ BOOST_LIBTHREAD="-mt"
+ else
+ AC_CHECKING(for libboost_thread.so library file)
+ AC_CHECK_FILE(${BOOSTDIR}/lib/libboost_thread.so,boost_ok=yes,boost_ok=no)
+ if test "x${boost_ok}" = "xyes" ; then
+ BOOST_LIBTHREAD="libboost_thread.so"
+ AC_MSG_RESULT(\$BOOST_LIBTHREAD = ${BOOST_LIBTHREAD})
+ BOOST_LIBTHREAD=""
+ fi
+ fi
+ if test "x${boost_ok}" = "xyes" ; then
+ if test "x${BOOSTDIR}" = "x/usr" ; then
+ BOOST_LIBS=""
+ else
+ BOOST_LIBS="-L${BOOSTDIR}/lib"
+ fi
AC_MSG_RESULT(\$BOOST_LIBS = ${BOOST_LIBS})
fi
fi
AC_CHECK_LIB(mpi,MPI_Init,WITHLAM="yes",WITHLAM="no")
if test "$WITHLAM" = "yes";then
MPI_LIBS="-lmpi $MPI_LIBS"
+ LIBS="-lmpi $LIBS"
fi
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ LIBS="-llammpi++ $LIBS"
+ AC_MSG_CHECKING(for MPI_Init in -llammpi++)
+ AC_TRY_LINK([
+ #include <mpi.h>
+ ], [MPI::Init();],
+ WITHLAM="yes",WITHLAM="no")
+ if test "$WITHLAM" = "yes";then
+ AC_MSG_RESULT(yes)
+ MPI_LIBS="-llammpi++ $MPI_LIBS"
+ else
+ AC_MSG_RESULT(no)
+ fi
+ AC_LANG_RESTORE
+
AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no")
fi
AC_CHECK_LIB(posix4,nanosleep, LIBS_PTHREADS="-lposix4",LIBS_PTHREADS="")
AC_CHECK_LIB(pthread,pthread_mutex_lock,
LIBS_PTHREADS="-lpthread $LIBS_PTHREADS",LIBS_PTHREADS="")
+else
+ LDFLAGS="-pthread $LDFLAGS"
fi
if test $flag = no && x$LIBS_PTHREADS = x; then
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
BOOST_LIBS = @BOOST_LIBS@
+BOOST_LIBTHREAD = @BOOST_LIBTHREAD@
# OpenPBS
else if(!CORBA::is_nil(mpi_ptr))
{
CORBA::release(sender);
- MPIReceiver<double,MPI_DOUBLE,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
+ MPIReceiver<double,SALOME::MPISenderDouble_ptr,SALOME::SenderDouble_ptr,SALOME_SenderDouble_i> rec(mpi_ptr);
return rec.getValue(size);
}
#endif
else if(!CORBA::is_nil(mpi_ptr))
{
CORBA::release(sender);
- MPIReceiver<int,MPI_INT,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
+ MPIReceiver<int,SALOME::MPISenderInt_ptr,SALOME::SenderInt_ptr,SALOME_SenderInt_i> rec(mpi_ptr);
return rec.getValue(size);
}
#endif
#ifdef HAVE_MPI2
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::MPIReceiver(CorbaSender mySender):_mySender(mySender){
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+MPIReceiver<T,CorbaSender,servForT,ptrForT>::~MPIReceiver(){
_mySender->release();
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getDistValue(long &size){
int i=0;
int myproc;
int sproc;
}
MPI_Recv( &_n, 1, MPI_LONG, sproc,p->tag1,com,&status);
_v = new T[_n];
- MPI_Recv( _v, _n, T2, sproc,p->tag2,com,&status);
+ MPI_Recv( _v, _n, MPITRAITS<T>::MpiType, sproc,p->tag2,com,&status);
_mySender->close(p);
MPI_Comm_disconnect( &com );
size=_n;
return _v;
}
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
-T *MPIReceiver<T,T2,CorbaSender,servForT,ptrForT>::getValue(long &size)
+template<class T,class CorbaSender,class servForT,class ptrForT>
+T *MPIReceiver<T,CorbaSender,servForT,ptrForT>::getValue(long &size)
{
return Receiver<T,servForT,ptrForT>::getValue(size,_mySender);
}
/*!
Receiver for MPI transfert.
*/
-template<class T,MPI_Datatype T2,class CorbaSender,class servForT,class ptrForT>
+template<class T>
+struct MPITRAITS
+{
+ static MPI_Datatype MpiType;
+};
+
+template<>
+MPI_Datatype MPITRAITS<double>::MpiType=MPI_DOUBLE;
+
+template<>
+MPI_Datatype MPITRAITS<int>::MpiType=MPI_INT;
+
+template<class T,class CorbaSender,class servForT,class ptrForT>
class MPIReceiver : public Receiver<T,servForT,ptrForT>
{
private:
void SALOME_MPISender_i::send()
{
_type=getTypeOfDataTransmitted();
- _argsForThr=new (void *)[8];
+ _argsForThr=new void *[8];
_argsForThr[0]=_portName;
_argsForThr[1]=&_lgrTabToSend;
_argsForThr[2]=(void *)_tabToSend;
Handle(SALOMEDSImpl_SComponent) sco = itcomponent.Value();
aCompType = sco->ComponentDataType();
//GEOM and MED are independent components
- if(aCompType == "GEOM" || aCompType == "MED") aSeq.Prepend(TCollection_ExtendedString(aCompType));
- else aSeq.Append(TCollection_ExtendedString(aCompType));
+ if (aCompType == "GEOM" || aCompType == "MED")
+ aSeq.Prepend(TCollection_ExtendedString(aCompType));
+ else
+ aSeq.Append(TCollection_ExtendedString(aCompType));
}
#ifdef WIN32
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("\\")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("\\") + theBaseName + TCollection_AsciiString(".py");
#else
- TCollection_AsciiString aFileName=thePath+TCollection_AsciiString("/")+theBaseName+TCollection_AsciiString(".py");
+ TCollection_AsciiString aFileName =
+ thePath + TCollection_AsciiString("/") + theBaseName + TCollection_AsciiString(".py");
#endif
//Create a file that will contain a main Study script
TCollection_AsciiString aBatchModeScript = "salome";
- //Output to the main Study script required Python modules import, set sys.path and add a creation of the study.
+ //Output to the main Study script required Python modules import,
+ //set sys.path and add a creation of the study.
fp << GetDumpStudyComment().ToCString() << endl << endl;
fp << "import sys" << endl;
fp << "import " << aBatchModeScript << "\n" << endl;
fp2.open(aFileName.ToCString(), ios::out);
#ifdef WIN32
- isOpened = fp.is_open();
+ isOpened = fp2.is_open();
#else
- isOpened = fp.rdbuf()->is_open();
+ isOpened = fp2.rdbuf()->is_open();
#endif
if(!isOpened) {
if (!strcmp(hdf_dataset->GetName(),"COMPONENTDATATYPE")) {
anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
- } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference")) {
+ } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") ||
+ !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance
theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
delete(current_string);
hdf_dataset->CloseOnDisk();
// function : PutFilesToStream
// purpose : converts the files from a list 'theFiles' to the stream
//============================================================================
-SALOMEDS::TMPFile*
-SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
- const SALOMEDS::ListOfFileNames& theFiles,
- const int theNamesOnly)
+namespace
{
- int i, aLength = theFiles.length();
- if(aLength == 0)
-// return NULL;
- return (new SALOMEDS::TMPFile);
-
- //Get a temporary directory for saved a file
- TCollection_AsciiString aTmpDir(const_cast<char*>(theFromDirectory.c_str()));
-
- long aBufferSize = 0;
- long aCurrentPos;
-
- int aNbFiles = 0;
- int* aFileNameSize= new int[aLength];
- long* aFileSize= new long[aLength];
-
- //Determine the required size of the buffer
-
- for(i=0; i<aLength; i++) {
-
- //Check if the file exists
+ SALOMEDS::TMPFile*
+ PutFilesToStream(const std::string& theFromDirectory,
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const SALOMEDS::ListOfFileNames& theFileNames,
+ const int theNamesOnly)
+ {
+ int i, aLength = theFiles.length();
+ if(aLength == 0)
+ return (new SALOMEDS::TMPFile);
+
+ //Get a temporary directory for saved a file
+ TCollection_AsciiString aTmpDir(const_cast<char*>(theFromDirectory.c_str()));
+
+ long aBufferSize = 0;
+ long aCurrentPos;
+
+ int aNbFiles = 0;
+ int* aFileNameSize= new int[aLength];
+ long* aFileSize= new long[aLength];
- if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
- TCollection_AsciiString aFullPath = aTmpDir + CORBA::string_dup(theFiles[i]);
- OSD_Path anOSDPath(aFullPath);
- OSD_File anOSDFile(anOSDPath);
- if(!anOSDFile.Exists()) continue;
+ //Determine the required size of the buffer
+
+ for(i=0; i<aLength; i++) {
+
+ //Check if the file exists
+
+ if (!theNamesOnly) { // mpv 15.01.2003: if only file names must be stroed, then size of files is zero
+ TCollection_AsciiString aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ OSD_Path anOSDPath(aFullPath);
+ OSD_File anOSDFile(anOSDPath);
+ if(!anOSDFile.Exists()) continue;
#ifdef WNT
- ifstream aFile(aFullPath.ToCString(), ios::binary);
+ ifstream aFile(aFullPath.ToCString(), ios::binary);
#else
- ifstream aFile(aFullPath.ToCString());
+ ifstream aFile(aFullPath.ToCString());
#endif
- aFile.seekg(0, ios::end);
- aFileSize[i] = aFile.tellg();
- aBufferSize += aFileSize[i]; //Add a space to store the file
- }
- aFileNameSize[i] = strlen(theFiles[i])+1;
- 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
- aNbFiles++;
- }
-
- aBufferSize += 4; //4 bytes for a number of the files that will be written to the stream;
- unsigned char* aBuffer = new unsigned char[aBufferSize];
- if(aBuffer == NULL)
-// return NULL;
- return (new SALOMEDS::TMPFile);
-
- //Initialize 4 bytes of the buffer by 0
- memset(aBuffer, 0, 4);
- //Copy the number of files that will be written to the stream
- memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int)));
-
-
- aCurrentPos = 4;
-
- for(i=0; i<aLength; i++) {
- ifstream *aFile;
- if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
- TCollection_AsciiString aFullPath = aTmpDir + CORBA::string_dup(theFiles[i]);
- OSD_Path anOSDPath(aFullPath);
- OSD_File anOSDFile(anOSDPath);
- if(!anOSDFile.Exists()) continue;
+ aFile.seekg(0, ios::end);
+ aFileSize[i] = aFile.tellg();
+ aBufferSize += aFileSize[i]; //Add a space to store the file
+ }
+ aFileNameSize[i] = strlen(theFileNames[i])+1;
+ 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
+ aNbFiles++;
+ }
+
+ aBufferSize += 4; //4 bytes for a number of the files that will be written to the stream;
+ unsigned char* aBuffer = new unsigned char[aBufferSize];
+ if(aBuffer == NULL)
+ return (new SALOMEDS::TMPFile);
+
+ //Initialize 4 bytes of the buffer by 0
+ memset(aBuffer, 0, 4);
+ //Copy the number of files that will be written to the stream
+ memcpy(aBuffer, &aNbFiles, ((sizeof(int) > 4) ? 4 : sizeof(int)));
+
+
+ aCurrentPos = 4;
+
+ for(i=0; i<aLength; i++) {
+ ifstream *aFile;
+ if (!theNamesOnly) { // mpv 15.01.2003: we don't open any file if theNamesOnly = true
+ TCollection_AsciiString aFullPath = aTmpDir + const_cast<char*>(theFiles[i].in());
+ OSD_Path anOSDPath(aFullPath);
+ OSD_File anOSDFile(anOSDPath);
+ if(!anOSDFile.Exists()) continue;
#ifdef WNT
- aFile = new ifstream(aFullPath.ToCString(), ios::binary);
+ aFile = new ifstream(aFullPath.ToCString(), ios::binary);
#else
- aFile = new ifstream(aFullPath.ToCString());
+ aFile = new ifstream(aFullPath.ToCString());
#endif
- }
- //Initialize 4 bytes of the buffer by 0
- memset((aBuffer + aCurrentPos), 0, 4);
- //Copy the length of the file name to the buffer
- memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int)));
- aCurrentPos += 4;
-
- //Copy the file name to the buffer
- memcpy((aBuffer + aCurrentPos), theFiles[i], aFileNameSize[i]);
- aCurrentPos += aFileNameSize[i];
-
- if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
- //Initialize 8 bytes of the buffer by 0
- memset((aBuffer + aCurrentPos), 0, 8);
- //Copy the length of the file to the buffer
- memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
- aCurrentPos += 8;
+ }
+ //Initialize 4 bytes of the buffer by 0
+ memset((aBuffer + aCurrentPos), 0, 4);
+ //Copy the length of the file name to the buffer
+ memcpy((aBuffer + aCurrentPos), (aFileNameSize + i), ((sizeof(int) > 4) ? 4 : sizeof(int)));
+ aCurrentPos += 4;
- aFile->seekg(0, ios::beg);
- aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
- aFile->close();
- delete(aFile);
- aCurrentPos += aFileSize[i];
+ //Copy the file name to the buffer
+ memcpy((aBuffer + aCurrentPos), theFileNames[i], aFileNameSize[i]);
+ aCurrentPos += aFileNameSize[i];
+
+ if (!theNamesOnly) { // mpv 15.01.2003: we don't copy file content to the buffer if !theNamesOnly
+ //Initialize 8 bytes of the buffer by 0
+ memset((aBuffer + aCurrentPos), 0, 8);
+ //Copy the length of the file to the buffer
+ memcpy((aBuffer + aCurrentPos), (aFileSize + i), ((sizeof(long) > 8) ? 8 : sizeof(long)));
+ aCurrentPos += 8;
+
+ aFile->seekg(0, ios::beg);
+ aFile->read((char *)(aBuffer + aCurrentPos), aFileSize[i]);
+ aFile->close();
+ delete(aFile);
+ aCurrentPos += aFileSize[i];
+ }
}
+
+ delete[] aFileNameSize;
+ delete[] aFileSize;
+
+
+ CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
+
+ return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1));
}
-
- delete[] aFileNameSize;
- delete[] aFileSize;
-
- CORBA::Octet* anOctetBuf = (CORBA::Octet*)aBuffer;
-
- return (new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1));
+}
+
+
+SALOMEDS::TMPFile*
+SALOMEDS_Tool::PutFilesToStream(const std::string& theFromDirectory,
+ const SALOMEDS::ListOfFileNames& theFiles,
+ const int theNamesOnly)
+{
+ SALOMEDS::ListOfFileNames aFileNames(theFiles);
+ return ::PutFilesToStream(theFromDirectory,theFiles,aFileNames,theNamesOnly);
+}
+
+
+SALOMEDS::TMPFile*
+SALOMEDS_Tool::PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
+ const SALOMEDS::ListOfFileNames& theFileNames)
+{
+ return ::PutFilesToStream("",theFiles,theFileNames,0);
}
//============================================================================
const SALOMEDS::ListOfFileNames& theFiles,
const int theNamesOnly = 0);
+ // Converts files listed in <theFiles> which will be named as pointed in the <theFileNames> into a byte sequence TMPFile
+ static SALOMEDS::TMPFile* PutFilesToStream(const SALOMEDS::ListOfFileNames& theFiles,
+ const SALOMEDS::ListOfFileNames& theFileNames);
+
// Converts a byte sequence <theStream> to files and places them in <theToDirectory>
static SALOMEDS::ListOfFileNames_var PutStreamToFiles(const SALOMEDS::TMPFile& theStream,
const std::string& theToDirectory,