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 2008 CodeRage, LLC (turkanis at coderage dot com) // (C) Copyright 2003-2007 Jonathan Turkanis // 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/iostreams for documentation. #ifndef BOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// min. #include
#include
// ptrdiff_t. #include
// streamsize, streamoff. #include
// boost::iterator_traits. #include
#include
#include
#include
#include
#include
// Must come last. #include
// MSVC. namespace boost { namespace iostreams { namespace detail { // Used for simulated tag dispatch. template
struct range_adapter_impl; // // Template name: range_adapter // Description: Device based on an instance of boost::iterator_range. // Template paramters: // Mode - A mode tag. // Range - An instance of iterator_range. // template
class range_adapter { private: typedef typename Range::iterator iterator; typedef boost::detail::iterator_traits
iter_traits; typedef typename iter_traits::iterator_category iter_cat; public: typedef typename Range::value_type char_type; struct category : Mode, device_tag { }; typedef typename mpl::if_< is_convertible< iter_cat, std::random_access_iterator_tag >, std::random_access_iterator_tag, std::forward_iterator_tag >::type tag; typedef range_adapter_impl
impl; explicit range_adapter(const Range& rng); range_adapter(iterator first, iterator last); std::streamsize read(char_type* s, std::streamsize n); std::streamsize write(const char_type* s, std::streamsize n); std::streampos seek(stream_offset off, BOOST_IOS::seekdir way); private: iterator first_, cur_, last_; }; //------------------Implementation of range_adapter---------------------------// template
range_adapter
::range_adapter(const Range& rng) : first_(rng.begin()), cur_(rng.begin()), last_(rng.end()) { } template
range_adapter
::range_adapter(iterator first, iterator last) : first_(first), cur_(first), last_(last) { } template
inline std::streamsize range_adapter
::read (char_type* s, std::streamsize n) { return impl::read(cur_, last_, s, n); } template
inline std::streamsize range_adapter
::write (const char_type* s, std::streamsize n) { return impl::write(cur_, last_, s, n); } template
std::streampos range_adapter
::seek (stream_offset off, BOOST_IOS::seekdir way) { impl::seek(first_, cur_, last_, off, way); return offset_to_position(cur_ - first_); } //------------------Implementation of range_adapter_impl----------------------// template<> struct range_adapter_impl
{ template
static std::streamsize read (Iter& cur, Iter& last, Ch* s,std::streamsize n) { std::streamsize rem = n; // No. of chars remaining. while (cur != last && rem-- > 0) *s++ = *cur++; return n - rem != 0 ? n - rem : -1; } template
static std::streamsize write (Iter& cur, Iter& last, const Ch* s, std::streamsize n) { while (cur != last && n-- > 0) *cur++ = *s++; if (cur == last && n > 0) throw write_area_exhausted(); return n; } }; template<> struct range_adapter_impl
{ template
static std::streamsize read (Iter& cur, Iter& last, Ch* s,std::streamsize n) { std::streamsize result = (std::min)(static_cast
(last - cur), n); if (result) std::copy(cur, cur + result, s); cur += result; return result != 0 ? result : -1; } template
static std::streamsize write (Iter& cur, Iter& last, const Ch* s, std::streamsize n) { std::streamsize count = (std::min)(static_cast
(last - cur), n); std::copy(s, s + count, cur); cur += count; if (count < n) throw write_area_exhausted(); return n; } template
static void seek ( Iter& first, Iter& cur, Iter& last, stream_offset off, BOOST_IOS::seekdir way ) { using namespace std; switch (way) { case BOOST_IOS::beg: if (off > last - first || off < 0) throw bad_seek(); cur = first + off; break; case BOOST_IOS::cur: { std::ptrdiff_t newoff = cur - first + off; if (newoff > last - first || newoff < 0) throw bad_seek(); cur += off; break; } case BOOST_IOS::end: if (last - first + off < 0 || off > 0) throw bad_seek(); cur = last + off; break; default: assert(0); } } }; } } } // End namespaces detail, iostreams, boost. #include
// MSVC. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_RANGE_ADAPTER_HPP_INCLUDED //---------------//
range_adapter.hpp
Page URL
File URL
Prev
8/8 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.