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
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library http://www.boost.org/ Copyright (c) 2001-2008 Hartmut Kaiser. 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) =============================================================================*/ #if !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED) #define CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED #include
#include
// this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace util { /////////////////////////////////////////////////////////////////////////////// // the class if_blocks handles recursive conditional compilation contexts class if_block { public: if_block() : status(true), some_part_status(true), enclosing_status(true), is_in_else(false) { } if_block(bool status_, bool enclosing_status_) : status(status_), some_part_status(status_), enclosing_status(enclosing_status_), is_in_else(false) { } void set_status(bool status_) { status = status_; if (status_) some_part_status = true; } bool get_status() const { return status; } bool get_some_part_status() const { return some_part_status; } bool get_enclosing_status() const { return enclosing_status; } bool get_in_else() const { return is_in_else; } void set_in_else() { is_in_else = true; } private: bool status; // Current block is true bool some_part_status; // One of the preceding or current #if/#elif was true bool enclosing_status; // Enclosing #if block is true bool is_in_else; // Inside the #else part }; /////////////////////////////////////////////////////////////////////////////// // stack of conditional compilation contexts class if_block_stack : private std::stack
{ public: typedef std::stack
::size_type size_type; void enter_if_block(bool new_status) { // If enclosing block is false, then this block is also false bool enclosing_status = get_status(); this->push (value_type (new_status && enclosing_status, enclosing_status)); } bool enter_elif_block(bool new_status) { if (!is_inside_ifpart()) return false; // #elif without matching #if if (get_enclosing_status()) { if (get_status()) { // entered a (false) #elif block from a true block this->top().set_status(false); } else if (new_status && !this->top().get_some_part_status()) { // Entered true #elif block and no previous block was true this->top().set_status(new_status); } } return true; } bool enter_else_block() { if (!is_inside_ifpart()) return false; // #else without matching #if if (get_enclosing_status()) { if (!this->top().get_some_part_status()) { // Entered (true) #else block and no previous block was true this->top().set_status(true); } else if (get_status()) { // Entered (false) #else block from true block this->top().set_status(false); } // Set else flag this->top().set_in_else(); } return true; } bool exit_if_block() { if (0 == this->size()) return false; // #endif without matching #if this->pop(); return true; } // return, whether the top (innermost) condition is true or false bool get_status() const { return 0 == this->size() || this->top().get_status(); } bool get_some_part_status() const { return 0 == this->size() || this->top().get_some_part_status(); } bool get_enclosing_status() const { return 0 == this->size() || this->top().get_enclosing_status(); } size_type get_if_block_depth() const { return this->size(); } protected: bool is_inside_ifpart() const { return 0 != this->size() && !this->top().get_in_else(); } bool is_inside_elsepart() const { return 0 != this->size() && this->top().get_in_else(); } }; /////////////////////////////////////////////////////////////////////////////// } // namespace util } // namespace wave } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #endif // !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
cpp_ifblock.hpp
Page URL
File URL
Prev 1/19
Next
Download
( 5 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.