Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-03-07 12:26:56 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:38:30 +0300
commit4dda5ac55dd97c5d72938093fa2072731afa6ff8 (patch)
tree0c1cefbcd5df3130d16ca451e94cfc3e74dc1284
parentc095c6e0f5161735642184179aae8a5f524db9c1 (diff)
[routing] Fixed mwm path.
-rw-r--r--routing/osrm2feature_map.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/routing/osrm2feature_map.cpp b/routing/osrm2feature_map.cpp
index 4ebb87f51d..c665e5eb24 100644
--- a/routing/osrm2feature_map.cpp
+++ b/routing/osrm2feature_map.cpp
@@ -353,15 +353,21 @@ bool OsrmFtSegBackwardIndex::Load(string const & nodesFileName, string const & b
void OsrmFtSegBackwardIndex::Construct(const OsrmFtSegMapping & mapping, const uint32_t maxNodeId, FilesMappingContainer & routingFile)
{
Clear();
+
// Calculate data file pathes
Platform const & p = GetPlatform();
+
+ /// @todo Find more suitable way to get mwm file name.
string const routingName = routingFile.GetName();
- string const name(routingName, routingName.rfind(my::GetNativeSeparator()) + 1,
- routingName.find(DATA_FILE_EXTENSION) - routingName.rfind(my::GetNativeSeparator()) - 1);
+ string const mwmName(routingName, 0, routingName.rfind(ROUTING_FILE_EXTENSION));
+ size_t const sepIndex = routingName.rfind(my::GetNativeSeparator());
+ string const name(routingName, sepIndex + 1, routingName.rfind(DATA_FILE_EXTENSION) - sepIndex - 1);
+
string const offsetsIndexName = p.GetIndexFileName(name, FEATURES_OFFSETS_TABLE_FILE_EXT);
string const bitsFileName = p.GetIndexFileName(name, FTSEG_MAPPING_BACKWARD_INDEX_BITS_EXT);
string const nodesFileName = p.GetIndexFileName(name, FTSEG_MAPPING_BACKWARD_INDEX_NODES_EXT);
- m_table = feature::FeaturesOffsetsTable::CreateIfNotExistsAndLoad(offsetsIndexName, FilesContainerR(name + DATA_FILE_EXTENSION));
+
+ m_table = feature::FeaturesOffsetsTable::CreateIfNotExistsAndLoad(offsetsIndexName, FilesContainerR(mwmName));
if (Load(bitsFileName, nodesFileName))
return;