Boost C++ 库

...世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

函数 split_unix - Boost C++ 函数库
PrevUpHomeNext

函数 split_unix

boost::program_options::split_unix

提要

// In header: <boost/program_options/parsers.hpp>


BOOST_PROGRAM_OPTIONS_DECL std::vector< std::string > 
split_unix(const std::string & cmdline, const std::string & seperator = " \t", 
           const std::string & quote = "'\"", 
           const std::string & escape = "\\");
BOOST_PROGRAM_OPTIONS_DECL std::vector< std::wstring > 
split_unix(const std::wstring & cmdline, 
           const std::wstring & seperator = L" \t", 
           const std::wstring & quote = L"'\"", 
           const std::wstring & escape = L"\\");

描述

将给定的字符串分割成一系列单独的字符串,这些字符串可以传递给命令行解析器。第二个参数用于指定用于分割的可能分隔符字符集合。分隔符默认为空格 " "。 分割方式遵循 Unix 风格,考虑了引号 '"' 和转义字符 '\'。


PrevUpHomeNext