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

Method CreateElement

libs/editor/server_api.cpp:58–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58uint64_t ServerApi06::CreateElement(editor::XMLFeature const & element) const
59{
60 OsmOAuth::Response const response =
61 m_auth.Request("/" + element.GetTypeString() + "/create", "PUT", element.ToOSMString());
62 if (response.first != OsmOAuth::HTTP::OK)
63 MYTHROW(CreateElementHasFailed, ("CreateElement request has failed:", response, "for", element));
64 uint64_t id;
65 if (!strings::to_uint64(response.second, id))
66 MYTHROW(CantParseServerResponse, ("Can't parse created node ID from server response."));
67 return id;
68}
69
70void ServerApi06::CreateElementAndSetAttributes(editor::XMLFeature & element) const
71{

Callers 1

CreateMethod · 0.80

Calls 4

to_uint64Function · 0.85
RequestMethod · 0.80
GetTypeStringMethod · 0.80
ToOSMStringMethod · 0.80

Tested by

no test coverage detected