Merge pull request #9594 from wwmayer/issue_9549_new
Part: fixes #9549: Part Fuse not working inside Part container
This commit is contained in:
@@ -291,6 +291,30 @@ std::string Base::Tools::escapeEncodeFilename(const std::string& s)
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string Base::Tools::quoted(const char* name)
|
||||
{
|
||||
std::stringstream str;
|
||||
str << "\"" << name << "\"";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
std::string Base::Tools::quoted(const std::string& name)
|
||||
{
|
||||
std::stringstream str;
|
||||
str << "\"" << name << "\"";
|
||||
return str.str();
|
||||
}
|
||||
|
||||
std::string Base::Tools::joinList(const std::vector<std::string>& vec,
|
||||
const std::string& sep)
|
||||
{
|
||||
std::stringstream str;
|
||||
for (const auto& it : vec) {
|
||||
str << it << sep;
|
||||
}
|
||||
return str.str();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
using namespace Base;
|
||||
|
||||
@@ -274,6 +274,29 @@ struct BaseExport Tools
|
||||
static inline QString fromStdString(const std::string & s) {
|
||||
return QString::fromUtf8(s.c_str(), static_cast<int>(s.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief quoted Creates a quoted string.
|
||||
* @param String to be quoted.
|
||||
* @return A quoted std::string.
|
||||
*/
|
||||
static std::string quoted(const char*);
|
||||
/**
|
||||
* @brief quoted Creates a quoted string.
|
||||
* @param String to be quoted.
|
||||
* @return A quoted std::string.
|
||||
*/
|
||||
static std::string quoted(const std::string&);
|
||||
|
||||
/**
|
||||
* @brief joinList
|
||||
* Join the vector of strings \a vec using the separator \a sep
|
||||
* @param vec
|
||||
* @param sep
|
||||
* @return
|
||||
*/
|
||||
static std::string joinList(const std::vector<std::string>& vec,
|
||||
const std::string& sep = ", ");
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user