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

Method Parse

libs/ge0/parser.cpp:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27bool Ge0Parser::Parse(std::string const & url, Result & result)
28{
29 // Original URL format:
30 //
31 // +------------------ 1 byte: zoom level
32 // |+-------+--------- 9 bytes: lat,lon
33 // || | +--+---- Variable number of bytes: point name
34 // || | | |
35 // cm://ZCoordba64/Name
36
37 // Alternative format (differs only in the prefix):
38 // http://comaps.app/ZCoordba64/Name
39
40 for (auto prefix : kGe0Prefixes)
41 if (url.starts_with(prefix))
42 return ParseAfterPrefix(url, prefix.size(), result);
43
44 return false;
45}
46
47bool Ge0Parser::ParseAfterPrefix(std::string const & url, size_t from, Result & result)
48{

Callers 5

UNIT_TESTFunction · 0.45
TestSuccessFunction · 0.45
TestFailureFunction · 0.45
UNIT_TESTFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by 4

UNIT_TESTFunction · 0.36
TestSuccessFunction · 0.36
TestFailureFunction · 0.36
UNIT_TESTFunction · 0.36