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
// (C) Copyright Gennadiy Rozental 2005-2007. // 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile$ // // Version : $Revision: 43798 $ // // Description : defines model of program environment variable // *************************************************************************** #ifndef BOOST_RT_ENV_VARIABLE_HPP_062604GER #define BOOST_RT_ENV_VARIABLE_HPP_062604GER // Boost.Runtime.Parameter #include
#include
#include
#include
#include
// Boost #include
namespace boost { namespace BOOST_RT_PARAM_NAMESPACE { namespace environment { // ************************************************************************** // // ************** runtime::environment::variable_data ************** // // ************************************************************************** // namespace rt_env_detail { struct variable_data : public runtime::parameter { cstring m_var_name; dstring m_global_id; argument_ptr m_value; }; } // namespace rt_env_detail // ************************************************************************** // // ************** runtime::environment::variable_base ************** // // ************************************************************************** // class variable_base { public: explicit variable_base( rt_env_detail::variable_data& data ) : m_data( &data ) {} // arguments access template
T const& value() const { return arg_value
( *m_data->m_value ); } template
void value( boost::optional
& res ) const { if( has_value() ) res = arg_value
( *m_data->m_value ); else res.reset(); } bool has_value() const { return m_data->m_value; } cstring name() const { return m_data->m_var_name; } protected: // Data members rt_env_detail::variable_data* m_data; } ; // ************************************************************************** // // ************** runtime::environment::variable ************** // // ************************************************************************** // template
class variable : public variable_base { public: // Constructors explicit variable( cstring var_name ); template
explicit variable( cstring var_name, Modifiers const& m ); explicit variable( rt_env_detail::variable_data& data ) : variable_base( data ) {} // other variable assignment void operator=( variable const& v ) { m_data = v.m_data; } // access methods T const& value() const { return variable_base::value
(); } using variable_base::value; // Value assignment template
void operator=( V const& v ) { if( !has_value() ) m_data->m_value.reset( new typed_argument
( *m_data ) ); arg_value
( *m_data->m_value ) = v; rt_env_detail::sys_write_var( m_data->m_var_name, format_stream().ref() << value() ); } }; // class variable //____________________________________________________________________________// template
inline std::basic_ostream
& operator<<( std::basic_ostream
& os, variable
const& v ) { os << v.name() << '='; if( v.has_value() ) os << v.value(); return os; } //____________________________________________________________________________// template
inline bool operator==( variable
ev, V const& v ) { return ev.has_value() && ev.value() == v; } //____________________________________________________________________________// template
inline bool operator==( V const& v, variable
ev ) { return ev.has_value() && ev.value() == v; } //____________________________________________________________________________// template
inline bool operator!=( variable
ev, V const& v ) { return !ev.has_value() || ev.value() != v; } //____________________________________________________________________________// template
inline bool operator!=( V const& v, variable
ev ) { return !ev.has_value() || ev.value() != v; } //____________________________________________________________________________// } // namespace environment } // namespace BOOST_RT_PARAM_NAMESPACE } // namespace boost // ************************************************************************** // // ************************************************************************** // // Implementation #include
// ************************************************************************** // // ************** runtime::environment::variable ************** // // ************************************************************************** // namespace boost { namespace BOOST_RT_PARAM_NAMESPACE { namespace environment { template
variable
::variable( cstring var_name ) : variable_base( environment::var
( var_name ) ) {} //____________________________________________________________________________// template
template
variable
::variable( cstring var_name, Modifiers const& m ) : variable_base( environment::var
( var_name, m ) ) {} //____________________________________________________________________________// } // namespace environment } // namespace BOOST_RT_PARAM_NAMESPACE } // namespace boost #endif // BOOST_RT_ENV_VARIABLE_HPP_062604GER
variable.hpp
Page URL
File URL
Prev
6/6 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.