mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 14:43:43 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -102,11 +102,9 @@ inline bool ReadVersion(fstream & f, uint32_t & version)
|
||||
return f.good();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
GpsTrackStorage::GpsTrackStorage(string const & filePath)
|
||||
: m_filePath(filePath)
|
||||
, m_itemCount(0)
|
||||
GpsTrackStorage::GpsTrackStorage(string const & filePath) : m_filePath(filePath), m_itemCount(0)
|
||||
{
|
||||
auto const createNewFile = [this]
|
||||
{
|
||||
@@ -121,7 +119,6 @@ GpsTrackStorage::GpsTrackStorage(string const & filePath)
|
||||
m_itemCount = 0;
|
||||
};
|
||||
|
||||
|
||||
// Open existing file
|
||||
m_stream.open(m_filePath, ios::in | ios::out | ios::binary);
|
||||
|
||||
@@ -175,8 +172,7 @@ void GpsTrackStorage::Append(vector<TItem> const & items)
|
||||
return;
|
||||
|
||||
// Write position must be after last item position
|
||||
ASSERT_EQUAL(m_stream.tellp(), static_cast<typename fstream::pos_type>(
|
||||
GetItemOffset(m_itemCount)), ());
|
||||
ASSERT_EQUAL(m_stream.tellp(), static_cast<typename fstream::pos_type>(GetItemOffset(m_itemCount)), ());
|
||||
|
||||
vector<char> buff(min(kItemBlockSize, items.size()) * kPointSize);
|
||||
for (size_t i = 0; i < items.size();)
|
||||
@@ -217,8 +213,7 @@ void GpsTrackStorage::Clear()
|
||||
MYTHROW(WriteException, ("File:", m_filePath));
|
||||
|
||||
// Write position is set to the first item in the file
|
||||
ASSERT_EQUAL(m_stream.tellp(), static_cast<typename fstream::pos_type>(
|
||||
GetItemOffset(0)), ());
|
||||
ASSERT_EQUAL(m_stream.tellp(), static_cast<typename fstream::pos_type>(GetItemOffset(0)), ());
|
||||
}
|
||||
|
||||
void GpsTrackStorage::ForEach(std::function<bool(TItem const & item)> const & fn)
|
||||
|
||||
Reference in New Issue
Block a user