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

Method CreateInfo

libs/indexer/data_source.cpp:166–187  ·  view source on GitHub ↗

DataSource ----------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

164
165// DataSource ----------------------------------------------------------------------------------
166std::unique_ptr<MwmInfo> DataSource::CreateInfo(platform::LocalCountryFile const & localFile) const
167{
168 MwmValue value(localFile);
169
170 feature::DataHeader const & h = value.GetHeader();
171
172 auto info = std::make_unique<MwmInfoEx>();
173 info->m_bordersRect = h.GetBounds();
174
175 auto const scaleR = h.GetScaleRange();
176 info->m_minScale = static_cast<uint8_t>(scaleR.first);
177 info->m_maxScale = static_cast<uint8_t>(scaleR.second);
178 info->m_version = value.GetMwmVersion();
179
180 if (value.m_cont.IsExist(REGION_INFO_FILE_TAG))
181 {
182 ReaderSource<FilesContainerR::TReader> src(value.m_cont.GetReader(REGION_INFO_FILE_TAG));
183 info->m_data.Deserialize(src);
184 }
185
186 return info;
187}
188
189std::unique_ptr<MwmValue> DataSource::CreateValue(MwmInfo & info) const
190{

Callers

nothing calls this directly

Calls 7

GetHeaderMethod · 0.80
GetMwmVersionMethod · 0.80
IsExistMethod · 0.80
GetBoundsMethod · 0.45
GetScaleRangeMethod · 0.45
GetReaderMethod · 0.45
DeserializeMethod · 0.45

Tested by

no test coverage detected