| 68 | } |
| 69 | |
| 70 | bool UserMarkIdStorage::CheckIds(kml::FileData const & fileData) const |
| 71 | { |
| 72 | // Storage is just created. Check failed. |
| 73 | if (m_isJustCreated) |
| 74 | return false; |
| 75 | |
| 76 | // There are ids of categories, bookmarks or tracks with values |
| 77 | // more than last stored maximums. Check failed. |
| 78 | if (fileData.m_categoryData.m_id != kml::kInvalidMarkGroupId && |
| 79 | fileData.m_categoryData.m_id > m_initialLastCategoryId) |
| 80 | { |
| 81 | return false; |
| 82 | } |
| 83 | |
| 84 | for (auto const & b : fileData.m_bookmarksData) |
| 85 | if (b.m_id != kml::kInvalidMarkId && b.m_id > m_initialLastBookmarkId) |
| 86 | return false; |
| 87 | |
| 88 | for (auto const & t : fileData.m_tracksData) |
| 89 | if (t.m_id != kml::kInvalidTrackId && t.m_id > m_initialLastTrackId) |
| 90 | return false; |
| 91 | |
| 92 | for (auto const & c : fileData.m_compilationsData) |
| 93 | if (c.m_id != kml::kInvalidMarkGroupId && c.m_id > m_initialLastCategoryId) |
| 94 | return false; |
| 95 | |
| 96 | // No one corner case. Check passed. |
| 97 | return true; |
| 98 | } |
| 99 | |
| 100 | kml::MarkId UserMarkIdStorage::GetNextUserMarkId(UserMark::Type type) |
| 101 | { |