QStringList alternative in STL or Boost
QStringList alternative in STL or Boost
在 Boost 或 STL 中是否有 QStringList 的替代品。我想要实现的是拆分路径,例如。dvb://1.2.3.4/launchpad/dyn/index.htm 只需在QString List中即可分隔字符串:
QStringList path = objectPath.split(QChar('/'), QString::SkipEmptyParts);
谢谢。
>boost::split
可以根据一个或多个分隔符将字符串拆分为std::vector<std::string>
:
#include <vector>
#include <string>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
std::vector<std::string> path_parts;
std::string s("some/file/path");
boost::split(path_parts, s, boost::is_any_of("/"));
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- boost::进程间消息队列引发错误
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- cmake如何在fedora工作站中找到boost静态库包
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- Boost Graph Library,修复节点大小
- 什么是"#include <boost/functional/hash.hpp> "?
- 瓦尔格林德:数学函数"Conditional jump or move depends on uninitialised value(s)"
- 基于boost的程序的静态链接——zlib问题
- 尝试使用生成文件编译程序时"fatal error: boost/regex.hpp: No such file or directory" C++
- boost:asio::read or boost:asio::async_read with timeout
- 如何修复"fatal error: boost/asio.hpp: no such file or directory"?
- boost::p rocess 如何知道进程何时退出"gracefully or not"?
- Visual Studio or boost::asio bug?
- QStringList alternative in STL or Boost
- 关于正则表达式与Boost的逻辑AND和OR匹配的说明
- 如何解决错误:"Missing required Boost components >= vX.XX, please install/upgrade Boost or configure you
- OpenMP v.2.0 or Boost thread 1.59
- Std or boost atomic unsigned char[32]
- const boost::array<T,N> or boost::array<const T,N>?