DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// Copyright Vladimir Prus 2002-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_CMDLINE_VP_2003_05_19 #define BOOST_CMDLINE_VP_2003_05_19 #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
namespace boost { namespace program_options { namespace detail { /** Command line parser class. Main requirements were: - Powerful enough to support all common uses. - Simple and easy to learn/use. - Minimal code size and external dependencies. - Extensible for custom syntaxes. First all options are registered. After that, elements of command line are extracted using operator++. For each element, user can find - if it's an option or an argument - name of the option - index of the option - option value(s), if any Sometimes the registered option name is not equal to the encountered one, for example, because name abbreviation is supported. Therefore two option names can be obtained: - the registered one - the one found at the command line There are lot of style options, which can be used to tune the command line parsing. In addition, it's possible to install additional parser which will process custom option styles. @todo mininal match length for guessing? */ class BOOST_PROGRAM_OPTIONS_DECL cmdline { public: typedef ::boost::program_options::command_line_style::style_t style_t; typedef function1
, const std::string&> additional_parser; typedef function1
, std::vector
&> style_parser; /** Constructs a command line parser for (argc, argv) pair. Uses style options passed in 'style', which should be binary or'ed values of style_t enum. It can also be zero, in which case a "default" style will be used. If 'allow_unregistered' is true, then allows unregistered options. They will be assigned index 1 and are assumed to have optional parameter. */ cmdline(const std::vector
& args); /** @overload */ cmdline(int argc, const char*const * argv); void style(int style); void allow_unregistered(); void set_options_description(const options_description& desc); void set_positional_options( const positional_options_description& m_positional); std::vector
run(); std::vector
parse_long_option(std::vector
& args); std::vector
parse_short_option(std::vector
& args); std::vector
parse_dos_option(std::vector
& args); std::vector
parse_disguised_long_option( std::vector
& args); std::vector
parse_terminator( std::vector
& args); std::vector
handle_additional_parser( std::vector
& args); /** Set additional parser. This will be called for each token of command line. If first string in pair is not empty, then the token is considered matched by this parser, and the first string will be considered an option name (which can be long or short), while the second will be option's parameter (if not empty). Note that additional parser can match only one token. */ void set_additional_parser(additional_parser p); void extra_style_parser(style_parser s); void check_style(int style) const; void init(const std::vector
& args); void finish_option(option& opt, std::vector
& other_tokens); // Copies of input. std::vector
args; style_t m_style; bool m_allow_unregistered; const options_description* m_desc; const positional_options_description* m_positional; additional_parser m_additional_parser; style_parser m_style_parser; }; void test_cmdline_detail(); }}} #endif
cmdline.hpp
Page URL
File URL
Prev 1/6
Next
Download
( 4 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.