MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / WriteDatabase

Method WriteDatabase

src/tw/twutil.cpp:351–377  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// WriteDatabase //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

349// WriteDatabase
350///////////////////////////////////////////////////////////////////////////////
351void cTWUtil::WriteDatabase(const TCHAR* filename,
352 cFCODatabaseFile& db,
353 bool bEncrypt,
354 const cElGamalSigPrivateKey* pPrivateKey)
355{
356 cFileHeader fileHeader;
357 fileHeader.SetID(db.GetFileHeaderID());
358
359 // I am almost positive that this does nothing, WriteObject() sets the version in the cFileHeader - Jun 8, 1999 - dmb
360 //fileHeader.SetVersion(1);
361
362#ifdef TW_PROFILE
363 cTaskTimer timer(_T("Write Database"));
364 timer.Start();
365#endif
366
367 WriteObject(filename, 0, db, fileHeader, bEncrypt, pPrivateKey);
368
369#ifdef TW_PROFILE
370 timer.Stop();
371#endif
372
373 iUserNotify::GetInstance()->Notify(iUserNotify::V_NORMAL,
374 _T("%s%s\n"),
375 TSS_GetString(cTW, tw::STR_WRITE_DB_FILE).c_str(),
376 cDisplayEncoder::EncodeInline(filename).c_str());
377}
378
379///////////////////////////////////////////////////////////////////////////////
380// ReadDatabase

Callers

nothing calls this directly

Calls 6

WriteObjectFunction · 0.85
StopMethod · 0.80
NotifyMethod · 0.80
c_strMethod · 0.80
SetIDMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected