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
/////////////////////////////////////////////////////////////////////////////// // hash_peek_bitset.hpp // // Copyright 2007 Eric Niebler. 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_XPRESSIVE_DETAIL_HASH_PEEK_BITSET_HPP_EAN_10_04_2005 #define BOOST_XPRESSIVE_DETAIL_HASH_PEEK_BITSET_HPP_EAN_10_04_2005 // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once # pragma warning(push) # pragma warning(disable : 4100) // unreferenced formal parameter # pragma warning(disable : 4127) // conditional expression constant #endif #include
#include
// for std::char_traits #include
namespace boost { namespace xpressive { namespace detail { /////////////////////////////////////////////////////////////////////////////// // hash_peek_bitset // template
struct hash_peek_bitset { typedef Char char_type; typedef typename std::char_traits
::int_type int_type; hash_peek_bitset() : icase_(false) , bset_() { } std::size_t count() const { return this->bset_.count(); } void set_all() { this->icase_ = false; this->bset_.set(); } template
void set_char(char_type ch, bool icase, Traits const &traits) { if(this->test_icase_(icase)) { ch = icase ? traits.translate_nocase(ch) : traits.translate(ch); this->bset_.set(traits.hash(ch)); } } template
void set_range(char_type from, char_type to, bool no, bool icase, Traits const &traits) { int_type ifrom = std::char_traits
::to_int_type(from); int_type ito = std::char_traits
::to_int_type(to); BOOST_ASSERT(ifrom <= ito); // bound the computational complexity. BUGBUG could set the inverse range if(no || 256 < (ito - ifrom)) { this->set_all(); } else if(this->test_icase_(icase)) { for(int_type i = ifrom; i <= ito; ++i) { char_type ch = std::char_traits
::to_char_type(i); ch = icase ? traits.translate_nocase(ch) : traits.translate(ch); this->bset_.set(traits.hash(ch)); } } } template
void set_class(typename Traits::char_class_type char_class, bool no, Traits const &traits) { if(1 != sizeof(char_type)) { // wide character set, no efficient way of filling in the bitset, so set them all to 1 this->set_all(); } else { for(std::size_t i = 0; i <= UCHAR_MAX; ++i) { char_type ch = std::char_traits
::to_char_type(static_cast
(i)); if(no != traits.isctype(ch, char_class)) { this->bset_.set(i); } } } } void set_bitset(hash_peek_bitset
const &that) { this->bset_ |= that.bset_; } void set_charset(basic_chset_8bit
const &that, bool icase) { if(this->test_icase_(icase)) { this->bset_ |= that.base(); } } bool icase() const { return this->icase_; } template
bool test(char_type ch, Traits const &traits) const { ch = this->icase_ ? traits.translate_nocase(ch) : traits.translate(ch); return this->bset_.test(traits.hash(ch)); } template
bool test(char_type ch, Traits const &traits, mpl::false_) const { BOOST_ASSERT(!this->icase_); return this->bset_.test(traits.hash(traits.translate(ch))); } template
bool test(char_type ch, Traits const &traits, mpl::true_) const { BOOST_ASSERT(this->icase_); return this->bset_.test(traits.hash(traits.translate_nocase(ch))); } private: // Make sure all sub-expressions being merged have the same case-sensitivity bool test_icase_(bool icase) { std::size_t count = this->bset_.count(); if(256 == count) { return false; // all set already, nothing to do } else if(0 != count && this->icase_ != icase) { this->set_all(); // icase mismatch! set all and bail return false; } this->icase_ = icase; return true; } bool icase_; std::bitset<256> bset_; }; }}} // namespace boost::xpressive::detail #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma warning(pop) #endif #endif
hash_peek_bitset.hpp
Page URL
File URL
Prev
7/16
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.