MCPcopy Create free account
hub / github.com/Kitware/VTK / ExtractScheme

Function ExtractScheme

IO/Core/vtkURI.cxx:58–72  ·  view source on GitHub ↗

The following functions extract one component and return an iterator one-past last component character They must be called in the right order to ensure coherency Scheme -> Authority -> Path -> Query -> Fragment

Source from the content-addressed store, hash-verified

56// They must be called in the right order to ensure coherency
57// Scheme -> Authority -> Path -> Query -> Fragment
58const char* ExtractScheme(const char* uri, const char* end, vtkURIComponent& output)
59{
60 const auto schemeEnd = std::find_if_not(uri, end,
61 [](char c)
62 { return std::isalnum(static_cast<unsigned char>(c)) || c == '+' || c == '-' || c == '.'; });
63
64 if (schemeEnd == end || *schemeEnd != ':')
65 {
66 return uri; // not a scheme
67 }
68
69 output = std::string{ uri, schemeEnd };
70
71 return schemeEnd + 1;
72}
73
74const char* ExtractAuthority(const char* uri, const char* end, vtkURIComponent& output)
75{

Callers 1

ParseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected