x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
parsers.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\program_options\detail\parsers.hpp
旋转
特效
属性
历史版本
// Copyright Vladimir Prus 2004. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PARSERS_HPP_VP_2004_05_06 #define BOOST_PARSERS_HPP_VP_2004_05_06 #include
namespace boost { namespace program_options { namespace detail { template
std::vector
> make_vector(Iterator i, Iterator e) { std::vector
> result; // Some compilers don't have templated constructor for // vector, so we can't create vector from (argv+1, argv+argc) range for(; i != e; ++i) result.push_back(*i); return result; } } template
basic_command_line_parser
:: basic_command_line_parser(const std::vector< std::basic_string
>& args) : detail::cmdline(to_internal(args)) {} template
basic_command_line_parser
:: basic_command_line_parser(int argc, charT* argv[]) : detail::cmdline( // Explicit template arguments are required by gcc 3.3.1 // (at least mingw version), and do no harm on other compilers. to_internal(detail::make_vector
(argv+1, argv+argc+!argc))) {} template
basic_command_line_parser
& basic_command_line_parser
::options(const options_description& desc) { detail::cmdline::set_options_description(desc); m_desc = &desc; return *this; } template
basic_command_line_parser
& basic_command_line_parser
::positional( const positional_options_description& desc) { detail::cmdline::set_positional_options(desc); return *this; } template
basic_command_line_parser
& basic_command_line_parser
::style(int style) { detail::cmdline::style(style); return *this; } template
basic_command_line_parser
& basic_command_line_parser
::extra_parser(ext_parser ext) { detail::cmdline::set_additional_parser(ext); return *this; } template
basic_command_line_parser
& basic_command_line_parser
::allow_unregistered() { detail::cmdline::allow_unregistered(); return *this; } template
basic_command_line_parser
& basic_command_line_parser
::extra_style_parser(style_parser s) { detail::cmdline::extra_style_parser(s); return *this; } template
basic_parsed_options
basic_command_line_parser
::run() { parsed_options result(m_desc); result.options = detail::cmdline::run(); // Presense of parsed_options -> wparsed_options conversion // does the trick. return basic_parsed_options
(result); } template
basic_parsed_options
parse_command_line(int argc, charT* argv[], const options_description& desc, int style, function1
, const std::string&> ext) { return basic_command_line_parser
(argc, argv).options(desc). style(style).extra_parser(ext).run(); } template
std::vector< std::basic_string
> collect_unrecognized(const std::vector< basic_option
>& options, enum collect_unrecognized_mode mode) { std::vector< std::basic_string
> result; for(unsigned i = 0; i < options.size(); ++i) { if (options[i].unregistered || (mode == include_positional && options[i].position_key != -1)) { copy(options[i].original_tokens.begin(), options[i].original_tokens.end(), back_inserter(result)); } } return result; } }} #endif
parsers.hpp
网页地址
文件地址
上一页
4/6
下一页
下载
( 4 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.