本文整理汇总了C++中URI::string方法的典型用法代码示例。如果您正苦于以下问题:C++ URI::string方法的具体用法?C++ URI::string怎么用?C++ URI::string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::string方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_mesh
void WriteMesh::write_mesh( const Mesh& mesh, const URI& file, const std::vector<URI>& fields)
{
update_list_of_available_writers();
/// @todo this should be improved to allow http(s) which would then upload the mesh
/// to a remote location after writing to a temporary file
/// uploading can be achieved using the curl library (which we already search for in the build system)
URI filepath = file;
if( filepath.scheme() != URI::Scheme::FILE )
filepath.scheme( URI::Scheme::FILE );
const std::string extension = filepath.extension();
if ( m_extensions_to_writers.count(extension) == 0 )
throw FileFormatError (FromHere(), "No meshwriter exists for files with extension " + extension);
if (m_extensions_to_writers[extension].size()>1)
{
std::string msg;
msg = filepath.string() + " has ambiguous extension " + extension + "\n"
+ "Possible writers for this extension are: \n";
boost_foreach(const Handle< MeshWriter > writer , m_extensions_to_writers[extension])
msg += " - " + writer->name() + "\n";
throw FileFormatError( FromHere(), msg);
}
示例2: add_signal_frame
XmlNode Protocol::add_signal_frame ( XmlNode& node, const std::string & target,
const URI & sender, const URI & receiver,
bool user_trans )
{
cf3_assert(sender.scheme() == URI::Scheme::CPATH);
cf3_assert(receiver.scheme() == URI::Scheme::CPATH);
XmlNode signalnode = node.add_node( Tags::node_frame() );
signalnode.set_attribute( "type", Tags::node_type_signal() );
signalnode.set_attribute( "target", target );
signalnode.set_attribute( "sender", sender.string() );
signalnode.set_attribute( "receiver", receiver.string() );
signalnode.set_attribute( "transaction", user_trans ? "user" : "auto" );
signalnode.set_attribute( "frameid", common::UUCount().string() );
return signalnode;
}
示例3: add_signal_frame
XmlNode Protocol::add_signal_frame ( XmlNode& node, const std::string & target,
const URI & sender, const URI & receiver,
bool user_trans )
{
cf_assert(sender.scheme() == URI::Scheme::CPATH);
cf_assert(receiver.scheme() == URI::Scheme::CPATH);
std::string uuid = boost::lexical_cast<std::string>(boost::uuids::random_generator()());
XmlNode signalnode = node.add_node( Tags::node_frame() );
signalnode.set_attribute( "type", Tags::node_type_signal() );
signalnode.set_attribute( "target", target );
signalnode.set_attribute( "sender", sender.string() );
signalnode.set_attribute( "receiver", receiver.string() );
signalnode.set_attribute( "transaction", user_trans ? "user" : "auto" );
signalnode.set_attribute( "frameid", uuid );
return signalnode;
}
示例4: btAddClicked
void GraphicalUriArray::btAddClicked()
{
if(m_editAdd->text().isEmpty())
{
if(m_comboType->currentText() == "cpath")
{
SelectPathDialog spd;
QString modified_path = m_editAdd->text();
URI path = spd.show(modified_path.toStdString());
if(!path.empty())
m_editAdd->setText( path.string().c_str() );
}
else if(m_comboType->currentText() == "file")
{
NRemoteOpen::Ptr nro = NRemoteOpen::create();
QStringList fileList = nro->showMultipleSelect("");
QStringList::iterator file = fileList.begin();
for( ; file != fileList.end() ; ++ file)
{
file->prepend( m_comboType->currentText() + ':' );
}
if(!fileList.isEmpty())
m_model->setStringList( m_model->stringList() << fileList );
}
}
if(!m_editAdd->text().isEmpty())
{
QString pathStr = m_editAdd->text();
if( !pathStr.startsWith(m_comboType->currentText()) )
pathStr.prepend(m_comboType->currentText() + ':');
m_model->setStringList( m_model->stringList() << pathStr );
m_editAdd->clear();
}
emit valueChanged();
}
示例5:
Common_API std::string to_str<URI> (const URI & v)
{
return v.string();
}