本文整理汇总了C++中URI::substr方法的典型用法代码示例。如果您正苦于以下问题:C++ URI::substr方法的具体用法?C++ URI::substr怎么用?C++ URI::substr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::substr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
HTTPEngineSender::del(const URI& uri)
{
const string path = (uri.substr(0, 6) == "path:/") ? uri.substr(6) : uri.str();
const string full_uri = _engine_url.str() + "/" + path;
SoupMessage* msg = soup_message_new(SOUP_METHOD_DELETE, full_uri.c_str());
soup_session_send_message(_session, msg);
}
示例2: model
void
HTTPEngineSender::put(const URI& uri,
const Resource::Properties& properties,
Resource::Graph ctx)
{
const string path = (uri.substr(0, 6) == "path:/") ? uri.substr(6) : uri.str();
const string full_uri = _engine_url.str() + "/" + path;
Sord::Model model(_world);
for (Resource::Properties::const_iterator i = properties.begin(); i != properties.end(); ++i)
model.add_statement(Sord::URI(_world, path),
AtomRDF::atom_to_node(model, i->first),
AtomRDF::atom_to_node(model, i->second));
const string str = model.write_to_string("");
SoupMessage* msg = soup_message_new(SOUP_METHOD_PUT, full_uri.c_str());
assert(msg);
soup_message_set_request(msg, "application/x-turtle", SOUP_MEMORY_COPY, str.c_str(), str.length());
soup_session_send_message(_session, msg);
}