Exemplo n.º 1
0
void
AtomWriter::forge_uri(const Raul::URI& uri)
{
	if (serd_uri_string_has_scheme((const uint8_t*)uri.c_str())) {
		lv2_atom_forge_urid(&_forge, _map.map_uri(uri.c_str()));
	} else {
		lv2_atom_forge_uri(&_forge, uri.c_str(), uri.length());
	}
}
Exemplo n.º 2
0
void
AtomWriter::response(int32_t id, Status status, const std::string& subject)
{
	if (!id) {
		return;
	}

	LV2_Atom_Forge_Frame msg;
	forge_request(&msg, _uris.patch_Response);
	lv2_atom_forge_key(&_forge, _uris.patch_request);
	lv2_atom_forge_int(&_forge, id);
	if (!subject.empty() && Raul::URI::is_valid(subject)) {
		lv2_atom_forge_key(&_forge, _uris.patch_subject);
		lv2_atom_forge_uri(&_forge, subject.c_str(), subject.length());
	}
	lv2_atom_forge_key(&_forge, _uris.patch_body);
	lv2_atom_forge_int(&_forge, static_cast<int>(status));
	lv2_atom_forge_pop(&_forge, &msg);
	finish_msg();
}
Exemplo n.º 3
0
 /** Forge a uri string */
 inline ForgeRef write_uri (const char* uri)       { return lv2_atom_forge_uri (this, uri, strlen (uri)); }