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_VARIABLES_MAP_VP_2003_05_19 #define BOOST_VARIABLES_MAP_VP_2003_05_19 #include
#include
#include
#include
#include
#include
namespace boost { namespace program_options { template
class basic_parsed_options; class value_semantic; class variables_map; // forward declaration /** Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value. */ BOOST_PROGRAM_OPTIONS_DECL void store(const basic_parsed_options
& options, variables_map& m, bool utf8 = false); /** Stores in 'm' all options that are defined in 'options'. If 'm' already has a non-defaulted value of an option, that value is not changed, even if 'options' specify some value. This is wide character variant. */ BOOST_PROGRAM_OPTIONS_DECL void store(const basic_parsed_options
& options, variables_map& m); /** Runs all 'notify' function for options in 'm'. */ BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map& m); /** Class holding value of option. Contains details about how the value is set and allows to conveniently obtain the value. */ class BOOST_PROGRAM_OPTIONS_DECL variable_value { public: variable_value() : m_defaulted(false) {} variable_value(const boost::any& v, bool defaulted) : v(v), m_defaulted(defaulted) {} /** If stored value if of type T, returns that value. Otherwise, throws boost::bad_any_cast exception. */ template
const T& as() const { return boost::any_cast
(v); } /** @overload */ template
T& as() { return boost::any_cast
(v); } /// Returns true if no value is stored. bool empty() const; /** Returns true if the value was not explicitly given, but has default value. */ bool defaulted() const; /** Returns the contained value. */ const boost::any& value() const; /** Returns the contained value. */ boost::any& value(); private: boost::any v; bool m_defaulted; // Internal reference to value semantic. We need to run // notifications when *final* values of options are known, and // they are known only after all sources are stored. By that // time options_description for the first source might not // be easily accessible, so we need to store semantic here. shared_ptr
m_value_semantic; friend BOOST_PROGRAM_OPTIONS_DECL void store(const basic_parsed_options
& options, variables_map& m, bool); friend BOOST_PROGRAM_OPTIONS_DECL void notify(variables_map& m); }; /** Implements string->string mapping with convenient value casting facilities. */ class BOOST_PROGRAM_OPTIONS_DECL abstract_variables_map { public: abstract_variables_map(); abstract_variables_map(const abstract_variables_map* next); virtual ~abstract_variables_map() {} /** Obtains the value of variable 'name', from *this and possibly from the chain of variable maps. - if there's no value in *this. - if there's next variable map, returns value from it - otherwise, returns empty value - if there's defaulted value - if there's next varaible map, which has a non-defauled value, return that - otherwise, return value from *this - if there's a non-defauled value, returns it. */ const variable_value& operator[](const std::string& name) const; /** Sets next variable map, which will be used to find variables not found in *this. */ void next(abstract_variables_map* next); private: /** Returns value of variable 'name' stored in *this, or empty value otherwise. */ virtual const variable_value& get(const std::string& name) const = 0; const abstract_variables_map* m_next; }; /** Concrete variables map which store variables in real map. This class is derived from std::map
, so you can use all map operators to examine its content. */ class BOOST_PROGRAM_OPTIONS_DECL variables_map : public abstract_variables_map, public std::map
{ public: variables_map(); variables_map(const abstract_variables_map* next); // Resolve conflict between inherited operators. const variable_value& operator[](const std::string& name) const { return abstract_variables_map::operator[](name); } private: /** Implementation of abstract_variables_map::get which does 'find' in *this. */ const variable_value& get(const std::string& name) const; /** Names of option with 'final' values -- which should not be changed by subsequence assignments. */ std::set
m_final; friend BOOST_PROGRAM_OPTIONS_DECL void store(const basic_parsed_options
& options, variables_map& xm, bool utf8); }; /* * Templates/inlines */ inline bool variable_value::empty() const { return v.empty(); } inline bool variable_value::defaulted() const { return m_defaulted; } inline const boost::any& variable_value::value() const { return v; } inline boost::any& variable_value::value() { return v; } }} #endif
variables_map.hpp
Page URL
File URL
Prev
11/12
Next
Download
( 6 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.