| 112 | } |
| 113 | |
| 114 | void TestFeature::Serialize(FeatureBuilder & fb) const |
| 115 | { |
| 116 | using feature::Metadata; |
| 117 | |
| 118 | // Iterate [1, FMD_COUNT). Absent types don't matter here. |
| 119 | size_t i = 1; |
| 120 | auto constexpr count = static_cast<size_t>(Metadata::EType::FMD_COUNT); |
| 121 | for (; i < count; ++i) |
| 122 | { |
| 123 | auto const type = static_cast<Metadata::EType>(i); |
| 124 | if (m_metadata.Has(type)) |
| 125 | fb.GetMetadata().Set(type, string(m_metadata.Get(type))); |
| 126 | } |
| 127 | |
| 128 | if (!m_geometry.empty()) |
| 129 | fb.AssignPoints(m_geometry); |
| 130 | |
| 131 | switch (m_type) |
| 132 | { |
| 133 | case Type::Point: |
| 134 | { |
| 135 | fb.SetCenter(m_center); |
| 136 | break; |
| 137 | } |
| 138 | case Type::Line: |
| 139 | { |
| 140 | fb.SetLinear(); |
| 141 | break; |
| 142 | } |
| 143 | case Type::Area: |
| 144 | { |
| 145 | fb.SetArea(); |
| 146 | break; |
| 147 | } |
| 148 | case Type::Unknown: break; |
| 149 | } |
| 150 | |
| 151 | m_names.ForEach([&](int8_t langCode, string_view name) |
| 152 | { |
| 153 | if (!name.empty()) |
| 154 | fb.SetName(langCode, name); |
| 155 | }); |
| 156 | |
| 157 | if (!m_postcode.empty()) |
| 158 | fb.GetParams().SetPostcode(m_postcode); |
| 159 | } |
| 160 | |
| 161 | // TestPlace ------------------------------------------------------------------------------------- |
| 162 | TestPlace::TestPlace(m2::PointD const & center, string const & name, string const & lang, uint32_t type, |
no test coverage detected