mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-29 23:26:00 +00:00
Merge with develop
--HG-- branch : compatibility-develop
This commit is contained in:
commit
f8e46962e2
1 changed files with 22 additions and 18 deletions
|
@ -132,22 +132,29 @@ void CCDBSynchronised::read( const string &fileName )
|
||||||
|
|
||||||
// value
|
// value
|
||||||
token = strtok(buffer," \t");
|
token = strtok(buffer," \t");
|
||||||
if( token == NULL ) continue;
|
|
||||||
sint64 value;
|
|
||||||
fromString((const char*)token, value);
|
|
||||||
|
|
||||||
// property name
|
if (token)
|
||||||
token = strtok(NULL," \n");
|
{
|
||||||
if( token == NULL ) continue;
|
sint64 value;
|
||||||
string propName(token);
|
fromString((const char*)token, value);
|
||||||
|
|
||||||
// set the value of the property
|
// property name
|
||||||
ICDBNode::CTextId txtId(propName);
|
token = strtok(NULL," \n");
|
||||||
_Database->setProp(txtId,value);
|
|
||||||
|
if (token)
|
||||||
|
{
|
||||||
|
string propName(token);
|
||||||
|
|
||||||
|
// set the value of the property
|
||||||
|
ICDBNode::CTextId txtId(propName);
|
||||||
|
_Database->setProp(txtId, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete [] buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
f.close();
|
f.close();
|
||||||
|
|
||||||
} // read //
|
} // read //
|
||||||
|
|
||||||
|
|
||||||
|
@ -160,7 +167,7 @@ void CCDBSynchronised::write( const string &fileName )
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
|
|
||||||
if( _Database != 0 )
|
if (_Database != 0)
|
||||||
{
|
{
|
||||||
FILE * f = nlfopen(fileName, "w");
|
FILE * f = nlfopen(fileName, "w");
|
||||||
if (f)
|
if (f)
|
||||||
|
@ -177,7 +184,6 @@ void CCDBSynchronised::write( const string &fileName )
|
||||||
{
|
{
|
||||||
nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str());
|
nlwarning("<CCDBSynchronised::write> can't write %s : the database has not been initialized",fileName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // write //
|
} // write //
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,11 +291,9 @@ string CCDBSynchronised::getString( uint32 id )
|
||||||
{
|
{
|
||||||
return (*itStr).second;
|
return (*itStr).second;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
nlwarning("<CCDBSynchronised::getString> string with id %d was not found",id);
|
||||||
nlwarning("<CCDBSynchronised::getString> string with id %d was not found",id);
|
return "";
|
||||||
return "";
|
|
||||||
}
|
|
||||||
} // getString //
|
} // getString //
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue