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

downloader_search_params.hpp « storage - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b33e92da005781383c2524eafa89052fd0dc9c53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

#include "storage/index.hpp"

#include "std/function.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"

namespace storage
{
struct DownloaderSearchResult
{
  DownloaderSearchResult(TCountryId const & countryId, string const & matchedName)
    : m_countryId(countryId), m_matchedName(matchedName)
  {
  }

  TCountryId m_countryId;
  /// \brief |m_matchedName| is a name of found feature in case of searching in World.mwm
  /// and is a local name of mwm (group or leaf) in case of searching in country tree.
  string m_matchedName;
};

struct DownloaderSearchResults
{
  DownloaderSearchResults() : m_endMarker(false) {}

  vector<DownloaderSearchResult> m_results;
  string m_query;
  /// \brief |m_endMarker| == true if it's the last call of TOnResults callback for the search.
  /// Otherwise |m_endMarker| == false.
  bool m_endMarker;
};

struct DownloaderSearchParams
{
  using TOnResults = function<void (DownloaderSearchResults const &)>;

  TOnResults m_onResults;
  string m_query;
  string m_inputLocale;
};
}  // namespace storage