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

Method ModifyElement

libs/editor/server_api.cpp:77–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77uint64_t ServerApi06::ModifyElement(editor::XMLFeature const & element) const
78{
79 std::string const id = element.GetAttribute("id");
80 CHECK(!id.empty(), ("id attribute is missing for", element));
81
82 OsmOAuth::Response const response =
83 m_auth.Request("/" + element.GetTypeString() + "/" + id, "PUT", element.ToOSMString());
84 if (response.first != OsmOAuth::HTTP::OK)
85 MYTHROW(ModifyElementHasFailed, ("ModifyElement request has failed:", response, "for", element));
86 uint64_t version;
87 if (!strings::to_uint64(response.second, version))
88 MYTHROW(CantParseServerResponse, ("Can't parse element version from server response", response.second));
89 return version;
90}
91
92void ServerApi06::ModifyElementAndSetVersion(editor::XMLFeature & element) const
93{

Callers 1

ModifyMethod · 0.80

Calls 6

to_uint64Function · 0.85
GetAttributeMethod · 0.80
RequestMethod · 0.80
GetTypeStringMethod · 0.80
ToOSMStringMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected