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_CONCEPT_ADAPTER_HPP_INCLUDED #define BOOST_IOSTREAMS_DETAIL_CONCEPT_ADAPTER_HPP_INCLUDED #include
// SFINAE. #include
#include
#include
#include
#include
#include
#include
#include
// pubsync. #include
#include
#include
#include
#include
// Must come last. #include
// MSVC. namespace boost { namespace iostreams { namespace detail { template
struct device_wrapper_impl; template
struct flt_wrapper_impl; template
class concept_adapter { private: typedef typename detail::value_type
::type value_type; typedef typename dispatch
::type input_tag; typedef typename dispatch
::type output_tag; typedef typename mpl::if_< is_device
, device_wrapper_impl
, flt_wrapper_impl
>::type input_impl; typedef typename mpl::if_< is_device
, device_wrapper_impl
, flt_wrapper_impl
>::type output_impl; typedef typename mpl::if_< is_device
, device_wrapper_impl
, flt_wrapper_impl
>::type any_impl; public: typedef typename char_type_of
::type char_type; typedef typename category_of
::type category; explicit concept_adapter(const reference_wrapper
& ref) : t_(ref.get()) { BOOST_STATIC_ASSERT(is_std_io
::value); } explicit concept_adapter(const T& t) : t_(t) { BOOST_STATIC_ASSERT(!is_std_io
::value); } T& operator*() { return t_; } T* operator->() { return &t_; } std::streamsize read(char_type* s, std::streamsize n) { return this->read(s, n, (basic_null_source
*) 0); } template
std::streamsize read(char_type* s, std::streamsize n, Source* src) { return input_impl::read(t_, src, s, n); } std::streamsize write(const char_type* s, std::streamsize n) { return this->write(s, n, (basic_null_sink
*) 0); } template
std::streamsize write(const char_type* s, std::streamsize n, Sink* snk) { return output_impl::write(t_, snk, s, n); } std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { return this->seek( off, way, which, (basic_null_device
*) 0); } template
std::streampos seek( stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, Device* dev ) { return any_impl::seek(t_, dev, off, way, which); } void close(BOOST_IOS::openmode which) { this->close(which, (basic_null_device
*) 0); } template
void close(BOOST_IOS::openmode which, Device* dev) { any_impl::close(t_, dev, which); } bool flush( BOOST_IOSTREAMS_BASIC_STREAMBUF(char_type, BOOST_IOSTREAMS_CHAR_TRAITS(char_type))* sb ) { bool result = any_impl::flush(t_, sb); if (sb && sb->BOOST_IOSTREAMS_PUBSYNC() == -1) result = false; return result; } template
// Avoid dependency on
void imbue(const Locale& loc) { iostreams::imbue(t_, loc); } std::streamsize optimal_buffer_size() const { return iostreams::optimal_buffer_size(t_); } public: concept_adapter& operator=(const concept_adapter&); value_type t_; }; //------------------Specializations of device_wrapper_impl--------------------// template<> struct device_wrapper_impl
{ template
static std::streampos seek( Device& dev, Dummy*, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { typedef typename category_of
::type category; return seek(dev, off, way, which, category()); } template
static std::streampos seek( Device&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) { throw cant_seek(); } template
static std::streampos seek( Device& dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access ) { return iostreams::seek(dev, off, way, which); } template
static void close(Device& dev, Dummy*, BOOST_IOS::openmode which) { iostreams::close(dev, which); } template
static bool flush(Device& dev, Dummy*) { return iostreams::flush(dev); } }; template<> struct device_wrapper_impl
: device_wrapper_impl
{ template
static std::streamsize read( Device& dev, Dummy*, typename char_type_of
::type* s, std::streamsize n ) { return iostreams::read(dev, s, n); } template
static std::streamsize write( Device&, Dummy*, const typename char_type_of
::type*, std::streamsize ) { throw cant_write(); } }; template<> struct device_wrapper_impl
{ template
static std::streamsize read(Device&, Dummy*, typename char_type_of
::type*, std::streamsize) { throw cant_read(); } template
static std::streamsize write( Device& dev, Dummy*, const typename char_type_of
::type* s, std::streamsize n ) { return iostreams::write(dev, s, n); } }; //------------------Specializations of flt_wrapper_impl--------------------// template<> struct flt_wrapper_impl
{ template
static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which ) { typedef typename category_of
::type category; return seek(f, dev, off, way, which, category()); } template
static std::streampos seek( Filter&, Device*, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) { throw cant_seek(); } template
static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access tag ) { typedef typename category_of
::type category; return seek(f, dev, off, way, which, tag, category()); } template
static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode, random_access, any_tag ) { return f.seek(*dev, off, way); } template
static std::streampos seek( Filter& f, Device* dev, stream_offset off, BOOST_IOS::seekdir way, BOOST_IOS::openmode which, random_access, two_sequence ) { return f.seek(*dev, off, way, which); } template
static void close(Filter& f, Device* dev, BOOST_IOS::openmode which) { iostreams::close(f, *dev, which); } template
static bool flush(Filter& f, Device* dev) { return iostreams::flush(f, *dev); } }; template<> struct flt_wrapper_impl
{ template
static std::streamsize read( Filter& f, Source* src, typename char_type_of
::type* s, std::streamsize n ) { return iostreams::read(f, *src, s, n); } template
static std::streamsize write( Filter&, Sink*, const typename char_type_of
::type*, std::streamsize ) { throw cant_write(); } }; template<> struct flt_wrapper_impl
{ template
static std::streamsize read(Filter&, Source*, typename char_type_of
::type*,std::streamsize) { throw cant_read(); } template
static std::streamsize write( Filter& f, Sink* snk, const typename char_type_of
::type* s, std::streamsize n ) { return iostreams::write(f, *snk, s, n); } }; //----------------------------------------------------------------------------// } } } // End namespaces detail, iostreams, boost. #include
// MSVC. #endif // #ifndef BOOST_IOSTREAMS_DETAIL_CONCEPT_ADAPTER_HPP_INCLUDED
concept_adapter.hpp
Page URL
File URL
Prev 1/8
Next
Download
( 9 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.