forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosm_source.hpp
48 lines (39 loc) · 1.25 KB
/
osm_source.hpp
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
44
45
46
47
48
#pragma once
#include "generator/emitter_interface.hpp"
#include "generator/generate_info.hpp"
#include "generator/osm_element.hpp"
#include <functional>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
class FeatureBuilder1;
class FeatureParams;
namespace generator
{
class SourceReader
{
struct Deleter
{
bool m_needDelete;
Deleter(bool needDelete = true) : m_needDelete(needDelete) {}
void operator()(std::istream * s) const
{
if (m_needDelete)
delete s;
}
};
std::unique_ptr<std::istream, Deleter> m_file;
public:
SourceReader();
explicit SourceReader(std::string const & filename);
explicit SourceReader(std::istringstream & stream);
uint64_t Read(char * buffer, uint64_t bufferSize);
};
bool GenerateFeatures(feature::GenerateInfo & info, std::shared_ptr<EmitterInterface> emitter);
bool GenerateRegionFeatures(feature::GenerateInfo & info, std::shared_ptr<EmitterInterface> emitter);
bool GenerateIntermediateData(feature::GenerateInfo & info);
void ProcessOsmElementsFromO5M(SourceReader & stream, std::function<void(OsmElement *)> processor);
void ProcessOsmElementsFromXML(SourceReader & stream, std::function<void(OsmElement *)> processor);
} // namespace generator