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. // Inspired by fdstream.hpp, (C) Copyright Nicolai M. Josuttis 2001, // available at http://www.josuttis.com/cppcode/fdstream.html. #ifndef BOOST_IOSTREAMS_FILE_DESCRIPTOR_HPP_INCLUDED #define BOOST_IOSTREAMS_FILE_DESCRIPTOR_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// file pathnames. #include
// intmax_t. #include
// tags. #include
#include
#include
#include
// openmode, seekdir, int types. #include
#include
// Must come last. #include
namespace boost { namespace iostreams { class BOOST_IOSTREAMS_DECL file_descriptor { public: #ifdef BOOST_IOSTREAMS_WINDOWS typedef void* handle_type; // A.k.a HANDLE #else typedef int handle_type; #endif typedef char char_type; struct category : seekable_device_tag, closable_tag { }; file_descriptor(); explicit file_descriptor(handle_type fd, bool close_on_exit = false); #ifdef BOOST_IOSTREAMS_WINDOWS explicit file_descriptor(int fd, bool close_on_exit = false); #endif explicit file_descriptor( const std::string& path, BOOST_IOS::openmode mode = BOOST_IOS::in | BOOST_IOS::out, BOOST_IOS::openmode base_mode = BOOST_IOS::in | BOOST_IOS::out ); explicit file_descriptor( const char* path, BOOST_IOS::openmode mode = BOOST_IOS::in | BOOST_IOS::out, BOOST_IOS::openmode base_mode = BOOST_IOS::in | BOOST_IOS::out ); void open( const std::string& path, BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out, BOOST_IOS::openmode base_mode = BOOST_IOS::in | BOOST_IOS::out ); void open( const char* path, BOOST_IOS::openmode = BOOST_IOS::in | BOOST_IOS::out, BOOST_IOS::openmode base_mode = BOOST_IOS::in | BOOST_IOS::out ); bool is_open() const { return pimpl_->flags_ != 0; } 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); void close(); handle_type handle() const { return pimpl_->handle_; } private: struct impl { impl() : #ifdef BOOST_IOSTREAMS_WINDOWS handle_(reinterpret_cast
(-1)), #else handle_(-1), #endif flags_(0) { } impl(handle_type fd, bool close_on_exit) : handle_(fd), flags_(0) { if (close_on_exit) flags_ |= impl::close_on_exit; } ~impl() { if (flags_ & close_on_exit) close_impl(*this); } enum flags { close_on_exit = 1, append = 4 }; handle_type handle_; int flags_; }; friend struct impl; static void close_impl(impl&); #ifdef BOOST_IOSTREAMS_WINDOWS static handle_type int_to_handle(int fd); #endif shared_ptr
pimpl_; }; struct file_descriptor_source : private file_descriptor { #ifdef BOOST_IOSTREAMS_WINDOWS typedef void* handle_type; // A.k.a HANDLE #else typedef int handle_type; #endif typedef char char_type; struct category : input_seekable, device_tag, closable_tag { }; using file_descriptor::read; using file_descriptor::seek; using file_descriptor::open; using file_descriptor::is_open; using file_descriptor::close; using file_descriptor::handle; file_descriptor_source() { } explicit file_descriptor_source(handle_type fd, bool close_on_exit = false) : file_descriptor(fd, close_on_exit) { } #ifdef BOOST_IOSTREAMS_WINDOWS explicit file_descriptor_source(int fd, bool close_on_exit = false) : file_descriptor(fd, close_on_exit) { } #endif explicit file_descriptor_source( const std::string& path, BOOST_IOS::openmode m = BOOST_IOS::in ) : file_descriptor(path, m & ~BOOST_IOS::out, BOOST_IOS::in) { } explicit file_descriptor_source( const char* path, BOOST_IOS::openmode m = BOOST_IOS::in ) : file_descriptor(path, m & ~BOOST_IOS::out, BOOST_IOS::in) { } }; struct file_descriptor_sink : private file_descriptor { #ifdef BOOST_IOSTREAMS_WINDOWS typedef void* handle_type; // A.k.a HANDLE #else typedef int handle_type; #endif typedef char char_type; struct category : output_seekable, device_tag, closable_tag { }; using file_descriptor::write; using file_descriptor::seek; using file_descriptor::open; using file_descriptor::is_open; using file_descriptor::close; using file_descriptor::handle; file_descriptor_sink() { } explicit file_descriptor_sink(handle_type fd, bool close_on_exit = false) : file_descriptor(fd, close_on_exit) { } #ifdef BOOST_IOSTREAMS_WINDOWS explicit file_descriptor_sink(int fd, bool close_on_exit = false) : file_descriptor(fd, close_on_exit) { } #endif explicit file_descriptor_sink( const std::string& path, BOOST_IOS::openmode m = BOOST_IOS::out ) : file_descriptor(path, m & ~BOOST_IOS::in, BOOST_IOS::out) { } explicit file_descriptor_sink( const char* path, BOOST_IOS::openmode m = BOOST_IOS::out ) : file_descriptor(path, m & ~BOOST_IOS::in, BOOST_IOS::out) { } }; } } // End namespaces iostreams, boost. #include
// pops abi_suffix.hpp pragmas #endif // #ifndef BOOST_IOSTREAMS_FILE_DESCRIPTOR_HPP_INCLUDED
file_descriptor.hpp
Page URL
File URL
Prev
4/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.