From: ribes Date: Wed, 14 May 2008 14:55:06 +0000 (+0000) Subject: Merger branche V4_1_0_maintainance X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d0595c619b18824790612455f776b02c3e38acb;p=modules%2Fkernel.git Merger branche V4_1_0_maintainance --- diff --git a/bin/setenv.py b/bin/setenv.py index 39ba85ca1..86a4803ba 100755 --- a/bin/setenv.py +++ b/bin/setenv.py @@ -70,13 +70,7 @@ def get_lib_dir(): global __lib__dir__ if __lib__dir__: return __lib__dir__ import platform - if platform.architecture()[0] == "64bit": - if platform.machine() == "ia64": - __lib__dir__ = "lib" - else: - __lib__dir__ = "lib" - else: - __lib__dir__ = "lib" + __lib__dir__ = "lib" return __lib__dir__ # ----------------------------------------------------------------------------- diff --git a/bin/virtual_salome.py b/bin/virtual_salome.py index 026dcb1c1..401b9ccab 100644 --- a/bin/virtual_salome.py +++ b/bin/virtual_salome.py @@ -80,13 +80,7 @@ def get_lib_dir(): global __lib__dir__ if __lib__dir__: return __lib__dir__ import platform - if platform.architecture()[0] == "64bit": - if platform.machine() == "ia64": - __lib__dir__ = "lib" - else: - __lib__dir__ = "lib" - else: - __lib__dir__ = "lib" + __lib__dir__ = "lib" return __lib__dir__ # ----------------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 4d28fad9f..e487aa532 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ # ================================================================ # #AC_PREREQ(2.59) -AC_INIT([Salome2 Project], [4.1.1], [paul.rascle@edf.fr], [SalomeKer]) +AC_INIT([Salome2 Project], [4.1.2], [paul.rascle@edf.fr], [SalomeKer]) # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary # scripts such as config.guess, install-sh, ... @@ -14,7 +14,7 @@ AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([tar-pax]) #AC_CONFIG_HEADER([config.h]) -XVERSION=0x040101 +XVERSION=0x040102 AC_SUBST(XVERSION) # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) diff --git a/doc/salome/salome_application.dox b/doc/salome/salome_application.dox index 0060c7794..d970338a3 100644 --- a/doc/salome/salome_application.dox +++ b/doc/salome/salome_application.dox @@ -42,14 +42,15 @@ computer. \section S2_sal_appl Application Directory -There is two ways for creation of an application directory +There are two ways for creation of an application directory, the recommended way is +the second, easier to configure.
  1. First way - references to different module directories -The script createAppli.sh in ${KERNEL_ROOT_DIR}/bin/SALOME creates an -application directory with the given path in parameter. ${APPLI} is a path +The script createAppli.sh in ${KERNEL_ROOT_DIR}/bin/salome creates an +application directory with the given path in parameter. The path given, ${APPLI}, is relative to ${HOME}. The directory is only a skeleton, the user has to edit several files to @@ -66,7 +67,7 @@ configure his own application. These files are described after, the list is: Second and easiest way - one single virtual install directory The user must create a %SALOME application configuration file by modifying a -copy of ${KERNEL_ROOT_DIR}/bin/SALOME/config_appli.xml. +copy of ${KERNEL_ROOT_DIR}/bin/salome/config_appli.xml. The file describes the list of %SALOME modules used in the application, with their respective installation path. The configuration file also defines the path of an existing script which sets the %SALOME prerequisites, @@ -74,19 +75,22 @@ and optionnaly, the path of samples directory (SAMPLES_SRC). The following command:: \code -python /bin/SALOME/appli_gen.py --prefix= --config= +python /bin/salome/appli_gen.py --prefix= --config= \endcode creates a virtual installation of %SALOME in the application directory ${APPLI} (bin, lib, doc, share...), with, for each file (executable, script, data, library, resources...), symbolic links to the actual file. +Note: it is recommended to set the environment for %SALOME prerequisites +before invoking the above command, in order to use the same python as SALOME, +otherwise installation may be wrong -Providing an existing an existing script for %SALOME prerequisites (the same one +Providing an existing script for %SALOME prerequisites (the same one used for modules compilation, or given with the modules installation), the installation works without further modification for a single computer (unless some modules needs a special environment not defined in the above script). For a distributed application (several computers), one must copy and adapt -CatalogResources.xml from ${KERNEL_ROOT_DIR}/bin/SALOME/appliskel (see below). +CatalogResources.xml from ${KERNEL_ROOT_DIR}/bin/salome/appliskel (see below).
@@ -112,8 +116,8 @@ script is used by run scripts. With the first way of installation, each user **must define** his own configuration for these scripts, following the above rules. -With the virtual installation (second way, above), env.d -scripts are built automatically. +With the virtual installation (second way, above), env.d +scripts are built automatically. **The following is only an example proposed by createAppli.sh, (first way of installation) not working as it is**. @@ -144,8 +148,8 @@ The %SALOME user can use 4 scripts: - runAppli Launches a %SALOME Session - (similar to ${KERNEL_ROOT_DIR}/bin/SALOME/runSALOME but with a different - name to avoid confusions). + (similar to ${KERNEL_ROOT_DIR}/bin/salome/runSalome but with a different + name to avoid confusions). See parameters below. - runSession Launches a shell script in the %SALOME application environment, with access @@ -158,9 +162,9 @@ The %SALOME user can use 4 scripts: It is also possible to use runSession, then python. - runTests - Similar to runSession, used for unit testing. runSession tries to use an + Similar to runSession, used for unit testing, but runSession tries to use an already existing naming service definition from a running session (hostname - and port number), runTests defines a new configuration for naming service + and port number), and runTests defines a new configuration for naming service (new port number).
  • @@ -172,8 +176,8 @@ The %SALOME user can use 4 scripts: For remote calls, %SALOME uses one script. - runRemote.sh - This script is mainly used to launch containers. The first 2 arguments - define the hostname and port userd for naming service, the remaining + This script is mainly used to launch containers. The first 3 arguments + define the hostname and port userd for naming service, plus a working directory, the remaining arguments define the command to execute.
  • @@ -249,10 +253,10 @@ If you have no active Python interpreter connected to your session, you can kill all the %SALOME servers of **all the sessions** on a given computer:: \code -./runSession killSALOME.py +./runSession killSalome.py \endcode -Remember! it's the same idea in *Windows (R) operating system* (Microsoft and Windows are either registered trademarks or trademarks of +Remember! it's the same idea in Windows (R) operating system (Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries) : use the start menu to stop... @@ -262,7 +266,7 @@ To kill a given session (when several session are running), one needs the naming service port number:: \code -./runSession killSALOMEWithPort 2810 +./runSession killSalomeWithPort 2810 \endcode Note that the port number of the last launched session can be found on Linux, @@ -285,8 +289,8 @@ This is used to launch a %SALOME Python script without GUI Example of script (test_session_geom.py): \code -import SALOME_session -SALOME_session.startSession(modules=["GEOM"]) +import salome_session +salome_session.startSession(modules=["GEOM"]) import GEOM_usinggeom raw_input("Press a key and the servers will be killed ...") \endcode @@ -313,13 +317,13 @@ first, launch a %SALOME session with gui, then, on another terminal:: python \endcode -Import %SALOME module. SALOME_init() without arguments creates a new study +Import %SALOME module. salome_init() without arguments creates a new study in the running session (note: SALOME_init(n) attachs to a running session whose studyId is n):: \code -import SALOME -SALOME.SALOME_init() +import salome +salome.salome_init() \endcode An example of script given with SMESH:: diff --git a/salome_adm/unix/config_files/ac_linker_options.m4 b/salome_adm/unix/config_files/ac_linker_options.m4 index 3c0065a07..ec3fe668d 100644 --- a/salome_adm/unix/config_files/ac_linker_options.m4 +++ b/salome_adm/unix/config_files/ac_linker_options.m4 @@ -29,10 +29,6 @@ AC_DEFUN([AC_LINKER_OPTIONS],[ AC_CHECKING(for LIB_LOCATION_SUFFIX) LIB_LOCATION_SUFFIX="" - case "$build_cpu" in - x86_64*) LIB_LOCATION_SUFFIX="" ;; - *) LIB_LOCATION_SUFFIX="" ;; - esac AC_SUBST(LIB_LOCATION_SUFFIX) AC_MSG_RESULT(LIB_LOCATION_SUFFIX is $LIB_LOCATION_SUFFIX) diff --git a/src/KERNEL_PY/salome_shared_modules.py b/src/KERNEL_PY/salome_shared_modules.py index 4d2212005..a1f2b2df8 100755 --- a/src/KERNEL_PY/salome_shared_modules.py +++ b/src/KERNEL_PY/salome_shared_modules.py @@ -79,13 +79,7 @@ if sys.platform == "win32": splitter = ";" path=salome_path.split(splitter) import platform -if platform.architecture()[0] == "64bit": - if platform.machine() == "ia64": - libdir = "lib" - else: - libdir = "lib" -else: - libdir = "lib" +libdir = "lib" for rep in path: # Import all *_shared_modules in rep for f in glob.glob(os.path.join(rep,libdir,"python"+sys.version[:3],"site-packages","salome","shared_modules","*_shared_modules.py")): diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index a18a09c8e..d1b105a37 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -44,8 +44,16 @@ #include "SALOME_LifeCycleCORBA.hxx" #ifndef WNT #include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog) +#include CORBA_CLIENT_HEADER(SALOME_Session) +#include CORBA_CLIENT_HEADER(DSC_Engines) +#include CORBA_CLIENT_HEADER(SALOME_Registry) +#include CORBA_CLIENT_HEADER(SALOMEDS) #else #include "SALOME_ModuleCatalog.hh" +#include "SALOME_Session.hh" +#include "DSC_Engines.hh" +#include "SALOME_Registry.hh" +#include "SALOMEDS.hh" #endif #include "SALOME_ContainerManager.hxx" #include "SALOME_Component_i.hxx" @@ -421,6 +429,100 @@ Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager() return resManager._retn(); } +//============================================================================= +/*! Public - + * shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd + */ +//============================================================================= + +void SALOME_LifeCycleCORBA::shutdownServers() +{ + // get each Container from NamingService => shutdown it + // (the order is inverse to the order of servers initialization) + + SALOME::Session_var session = SALOME::Session::_nil(); + CORBA::Long pid = 0; + CORBA::Object_var objS = _NS->Resolve("/Kernel/Session"); + if (!CORBA::is_nil(objS)) + { + session = SALOME::Session::_narrow(objS); + if (!CORBA::is_nil(session)) + { + pid = session->getPID(); + session->ping(); + } + } + + string hostname = GetHostname(); + + // 1) SalomeLauncher + CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher"); + Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL); + if (!CORBA::is_nil(launcher) && (pid != launcher->getPID())) + launcher->Shutdown(); + + // 2) ConnectionManager + CORBA::Object_var objCnM=_NS->Resolve("/ConnectionManager"); + Engines::ConnectionManager_var connMan=Engines::ConnectionManager::_narrow(objCnM); + if ( !CORBA::is_nil(connMan) && ( pid != connMan->getPID() ) ) + connMan->ShutdownWithExit(); + + // 3) SALOMEDS + CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager"); + SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ; + if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) ) + studyManager->Shutdown(); + + // 4) ModuleCatalog + CORBA::Object_var objMC=_NS->Resolve("/Kernel/ModulCatalog"); + SALOME_ModuleCatalog::ModuleCatalog_var catalog = SALOME_ModuleCatalog::ModuleCatalog::_narrow(objMC); + if ( !CORBA::is_nil(catalog) && ( pid != catalog->getPID() ) ) + catalog->shutdown(); + + // 5) Registry + CORBA::Object_var objR = _NS->Resolve("/Registry"); + Registry::Components_var registry = Registry::Components::_narrow(objR); + if ( !CORBA::is_nil(registry) && ( pid != registry->getPID() ) ) + registry->Shutdown(); +} + +//============================================================================= +/*! Public - + * shutdown omniNames and notifd + */ +//============================================================================= + +void SALOME_LifeCycleCORBA::killOmniNames() +{ + string portNumber (::getenv ("NSPORT") ); + if ( !portNumber.empty() ) + { + string cmd ; + cmd = string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*") + + portNumber + + string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" ); + MESSAGE(cmd); + system ( cmd.c_str() ); + } + + // NPAL 18309 (Kill Notifd) + if ( !portNumber.empty() ) + { + string cmd = ("import pickle, os; "); + cmd += string("from killSalomeWithPort import getPiDict; "); + cmd += string("filedict=getPiDict(") + portNumber + "); "; + cmd += string("f=open(filedict, 'r'); "); + cmd += string("pids=pickle.load(f); "); + cmd += string("m={}; "); + cmd += string("[ m.update(i) for i in pids ]; "); + cmd += string("pids=filter(lambda a: 'notifd' in m[a], m.keys()); "); + cmd += string("[ os.kill(pid, 9) for pid in pids ]; "); + cmd += string("os.remove(filedict); "); + cmd = string("python -c \"") + cmd +"\" > /dev/null"; + MESSAGE(cmd); + system( cmd.c_str() ); + } +} //============================================================================= /*! Protected - diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index ced93eb1e..42e67688d 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -104,6 +104,9 @@ public: Engines::ContainerManager_ptr getContainerManager(); Engines::ResourcesManager_ptr getResourcesManager(); + void shutdownServers(); + static void killOmniNames(); + protected: /*! Establish if a component called "componentName" in a container called diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx index 0539b5e81..27abce57b 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfInteger.cxx @@ -432,107 +432,122 @@ vector SALOMEDSImpl_AttributeTableOfInteger::GetSetColumnIndices(const int string SALOMEDSImpl_AttributeTableOfInteger::Save() { - ostrstream theStream; + string aString; + char* buffer = new char[1024]; int i, j, l; - theStream.precision(64); - //Title l = myTitle.size(); - theStream << l << "\n"; - for(i=0; ifirst << "\n"; - theStream << p->second << "\n"; + sprintf(buffer, "%d\n%d\n", p->first, p->second); + aString += buffer; } - string aString((char*)theStream.rdbuf()->str()); + delete []buffer; return aString; } + + void SALOMEDSImpl_AttributeTableOfInteger::Load(const string& value) { - istrstream theStream(value.c_str(), strlen(value.c_str())); - Backup(); + vector v; + int i, j, l, pos, aSize = (int)value.size(); + for(i = 0, pos = 0; i> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTitle = std::string(l, 0); for(i=0; i> anExtChar; - myTitle[i] = anExtChar; + myTitle[i] = v[pos++][0]; } //Nb rows - theStream >> myNbRows; + myNbRows = strtol(v[pos++].c_str(), NULL, 10); //Rows titles myRows.clear(); for(i=1; i<=myNbRows; i++) { - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myRows.push_back(aStr); } //Nb columns - theStream >> myNbColumns; + myNbColumns = strtol(v[pos++].c_str(), NULL, 10); //Columns titles myCols.clear(); for(i=1; i<=myNbColumns; i++) { - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myCols.push_back(aStr); } //Restore the table values - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTable.clear(); for(i=1; i<=l; i++) { - int aKey, aValue; - theStream >> aKey; - theStream >> aValue; + int aKey = strtol(v[pos++].c_str(), NULL, 10); + int aValue = strtol(v[pos++].c_str(), NULL, 10); myTable[aKey] = aValue; } } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx index 64c5f03a6..2c3aba89e 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfReal.cxx @@ -432,109 +432,120 @@ vector SALOMEDSImpl_AttributeTableOfReal::GetSetColumnIndices(const int the string SALOMEDSImpl_AttributeTableOfReal::Save() { - ostrstream theStream; + string aString; + char* buffer = new char[1024]; int i, j, l; //Title l = myTitle.size(); - theStream << l << "\n"; - for(i=0; ifirst << "\n"; - sprintf(aBuffer, "%.64e", p->second); - theStream << aBuffer << "\n"; + sprintf(buffer, "%d\n%.64e\n", p->first, p->second); + aString += buffer; } - - delete []aBuffer; - string aString((char*)theStream.rdbuf()->str()); + + delete []buffer; return aString; } void SALOMEDSImpl_AttributeTableOfReal::Load(const string& value) { - istrstream theStream(value.c_str(), strlen(value.c_str())); - Backup(); + vector v; + int i, j, l, pos, aSize = (int)value.size(); + for(i = 0, pos = 0; i> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTitle = std::string(l, 0); for(i=0; i> anExtChar; - myTitle[i] = anExtChar; + myTitle[i] = v[pos++][0]; } //Nb rows - theStream >> myNbRows; + myNbRows = strtol(v[pos++].c_str(), NULL, 10); //Rows titles myRows.clear(); for(i=1; i<=myNbRows; i++) { - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myRows.push_back(aStr); } //Nb columns - theStream >> myNbColumns; + myNbColumns = strtol(v[pos++].c_str(), NULL, 10); //Columns titles myCols.clear(); for(i=1; i<=myNbColumns; i++) { - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myCols.push_back(aStr); } //Restore the table values - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTable.clear(); for(i=1; i<=l; i++) { - int aKey; - double aValue; - theStream >> aKey; - theStream >> aValue; + int aKey = strtol(v[pos++].c_str(), NULL, 10); + double aValue = strtod(v[pos++].c_str(), NULL); myTable[aKey] = aValue; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx index 245de358c..350dc0b28 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTableOfString.cxx @@ -433,131 +433,137 @@ vector SALOMEDSImpl_AttributeTableOfString::GetSetColumnIndices(const int t string SALOMEDSImpl_AttributeTableOfString::Save() { - ostrstream theStream; + string aString; + char* buffer = new char[1024]; int i, j, l; - + //Title l = myTitle.size(); - theStream << l << "\n"; - for(i=0; isecond.size()) { // check empty string in the value table - theStream << p->first << "\n"; + sprintf(buffer, "%d\n", p->first); + aString += buffer; unsigned long aValueSize = p->second.size(); - theStream<second.c_str(),aValueSize); - theStream<<"\n"; + sprintf(buffer, "%ld\n", aValueSize); + aString +=buffer; + aString += p->second; + aString += '\n'; } else { // write index only of kind: "0key"; "05", for an example - theStream << "0" << p->first << "\n"; + sprintf(buffer, "0%d\n", p->first); + aString+=buffer; } } - string aString((char*)theStream.rdbuf()->str()); + + delete []buffer; return aString; } void SALOMEDSImpl_AttributeTableOfString::Load(const string& value) { - istrstream theStream(value.c_str(), strlen(value.c_str())); - Backup(); - - theStream.seekg(0, ios::end); - long aSize = theStream.tellg(); - theStream.seekg(0, ios::beg); + vector v; + int i, j, l, pos, aSize = (int)value.size(); + for(i = 0, pos = 0; i> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTitle = std::string(l, 0); for(i=0; i> anExtChar; - myTitle[i] = anExtChar; + myTitle[i] = v[pos++][0]; } //Nb rows - theStream >> myNbRows; + myNbRows = strtol(v[pos++].c_str(), NULL, 10); //Rows titles myRows.clear(); - for(i=0; i> l; + for(i=1; i<=myNbRows; i++) { + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myRows.push_back(aStr); } //Nb columns - theStream >> myNbColumns; + myNbColumns = strtol(v[pos++].c_str(), NULL, 10); //Columns titles myCols.clear(); - for(i=0; i> l; + for(i=1; i<=myNbColumns; i++) { + l = strtol(v[pos++].c_str(), NULL, 10); aStr = std::string(l,0); for(j=0; j> anExtChar; - aStr[j] = anExtChar; + aStr[j] = v[pos++][0]; } myCols.push_back(aStr); } //Restore the table values - string aValue; - theStream >> l; + l = strtol(v[pos++].c_str(), NULL, 10); myTable.clear(); - theStream.getline(aValueString,aSize,'\n'); for(i=1; i<=l; i++) { - int aKey; - - theStream.getline(aValueString,aSize,'\n'); - aValue = aValueString; - aKey = atoi(aValue.c_str()); - if (aValue[0] == '0') + aStr = v[pos++]; //Ket as a string + int aKey = strtol(aStr.c_str(), NULL, 10); + string aValue; + if(aStr[0] == '0') //If the first character of the key is 0, then empty value aValue = ""; else { - unsigned long aValueSize; - theStream >> aValueSize; - theStream.read(aValueString, 1); // an '\n' omitting - theStream.read(aValueString, aValueSize); - theStream.read(aValueString, 1); // an '\n' omitting - aValue = aValueString; + long aSize = strtol(v[pos++].c_str(), NULL, 10); + aValue = v[pos++]; } myTable[aKey] = aValue; } - delete(aValueString); }