MCPcopy Create free account
hub / github.com/comaps/comaps / Clear

Method Clear

libs/map/gps_track_storage.cpp:199–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void GpsTrackStorage::Clear()
200{
201 ASSERT(m_stream.is_open(), ());
202
203 m_itemCount = 0;
204
205 m_stream.close();
206
207 m_stream.open(m_filePath, ios::in | ios::out | ios::binary | ios::trunc);
208
209 if (!m_stream)
210 MYTHROW(WriteException, ("File:", m_filePath));
211
212 if (!WriteVersion(m_stream, kCurrentVersion))
213 MYTHROW(WriteException, ("File:", m_filePath));
214
215 // Write position is set to the first item in the file
216 ASSERT_EQUAL(m_stream.tellp(), static_cast<typename fstream::pos_type>(GetItemOffset(0)), ());
217}
218
219void GpsTrackStorage::ForEach(std::function<bool(TItem const & item)> const & fn)
220{

Callers

nothing calls this directly

Calls 5

ASSERTFunction · 0.85
GetItemOffsetFunction · 0.85
openMethod · 0.80
WriteVersionFunction · 0.70
closeMethod · 0.45

Tested by

no test coverage detected