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

Function AddFile

src/twtest/dbdatasource_t.cpp:46–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#include "fs/fsobject.h"
45
46static void AddFile(cDbDataSourceIter& iter, const TSTRING& filename, bool with_data = false)
47{
48 if (iter.SeekTo(filename.c_str()))
49 TCOUT << "Object " << filename << " already exists!" << std::endl;
50
51 cFCOName fname(filename);
52
53 if (with_data)
54 {
55 iFCO* pFCO = new cFSObject(fname);
56 iter.AddFCO(filename, pFCO);
57 }
58 else
59 {
60 iter.AddFCO(filename, 0);
61 }
62
63 TEST(iter.HasFCOData() == with_data);
64}
65
66static void AddDirectory(cDbDataSourceIter& iter, const TSTRING& filename)
67{

Callers 1

TestDbDataSourceBasicFunction · 0.70

Calls 4

c_strMethod · 0.80
AddFCOMethod · 0.80
HasFCODataMethod · 0.80
SeekToMethod · 0.45

Tested by 1

TestDbDataSourceBasicFunction · 0.56