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 2005-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_LINE_FILTER_HPP_INCLUDED #define BOOST_IOSTREAMS_LINE_FILTER_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include
// min. #include
#include
// allocator. #include
#include
// BOOST_STATIC_CONSTANT. #include
#include
// openmode, streamsize. #include
// check_eof #include
#include
// Must come last. #include
// VC7.1 C4244. namespace boost { namespace iostreams { // // Template name: line_filter. // Template paramters: // Ch - The character type. // Alloc - The allocator type. // Description: Filter which processes data one line at a time. // template< typename Ch, typename Alloc = #if BOOST_WORKAROUND(__GNUC__, < 3) typename std::basic_string
::allocator_type #else std::allocator
#endif > class basic_line_filter { private: typedef typename std::basic_string
::traits_type string_traits; public: typedef Ch char_type; typedef char_traits
traits_type; typedef std::basic_string< Ch, string_traits, Alloc > string_type; struct category : dual_use, filter_tag, multichar_tag, closable_tag { }; protected: basic_line_filter() : pos_(string_type::npos), state_(0) { } public: virtual ~basic_line_filter() { } template
std::streamsize read(Source& src, char_type* s, std::streamsize n) { using namespace std; assert(!(state_ & f_write)); state_ |= f_read; // Handle unfinished business. std::streamsize result = 0; if (!cur_line_.empty() && (result = read_line(s, n)) == n) return n; typename traits_type::int_type status = traits_type::good(); while (result < n && !traits_type::is_eof(status)) { // Call next_line() to retrieve a line of filtered test, and // read_line() to copy it into buffer s. if (traits_type::would_block(status = next_line(src))) return result; result += read_line(s + result, n - result); } return detail::check_eof(result); } template
std::streamsize write(Sink& snk, const char_type* s, std::streamsize n) { using namespace std; assert(!(state_ & f_read)); state_ |= f_write; // Handle unfinished business. if (pos_ != string_type::npos && !write_line(snk)) return 0; const char_type *cur = s, *next; while (true) { // Search for the next full line in [cur, s + n), filter it // and write it to snk. typename string_type::size_type rest = n - (cur - s); if ((next = traits_type::find(cur, rest, traits_type::newline()))) { cur_line_.append(cur, next - cur); cur = next + 1; if (!write_line(snk)) return static_cast
(cur - s); } else { cur_line_.append(cur, rest); return n; } } } template
void close(Sink& snk, BOOST_IOS::openmode which) { if ((state_ & f_read) && which == BOOST_IOS::in) close_impl(); if ((state_ & f_write) && which == BOOST_IOS::out) { try { if (!cur_line_.empty()) write_line(snk); } catch (...) { try { close_impl(); } catch (...) { } throw; } close_impl(); } } private: virtual string_type do_filter(const string_type& line) = 0; // Copies filtered characters fron the current line into // the given buffer. std::streamsize read_line(char_type* s, std::streamsize n) { using namespace std; std::streamsize result = (std::min) (n, static_cast
(cur_line_.size())); traits_type::copy(s, cur_line_.data(), result); cur_line_.erase(0, result); return result; } // Attempts to retrieve a line of text from the given source; returns // an int_type as a good/eof/would_block status code. template
typename traits_type::int_type next_line(Source& src) { using namespace std; typename traits_type::int_type c; while ( traits_type::is_good(c = iostreams::get(src)) && c != traits_type::newline() ) { cur_line_ += traits_type::to_int_type(c); } if (!traits_type::would_block(c)) { if (!cur_line_.empty() || c == traits_type::newline()) cur_line_ = do_filter(cur_line_); if (c == traits_type::newline()) cur_line_ += c; } return c; // status indicator. } // Filters the current line and attemps to write it to the given sink. // Returns true for success. template
bool write_line(Sink& snk) { string_type line = do_filter(cur_line_) + traits_type::newline(); std::streamsize amt = static_cast
(line.size()); bool result = iostreams::write(snk, line.data(), amt) == amt; if (result) clear(); return result; } void close_impl() { clear(); state_ = 0; } void clear() { cur_line_.erase(); pos_ = string_type::npos; } enum flag_type { f_read = 1, f_write = f_read << 1 }; string_type cur_line_; typename string_type::size_type pos_; int state_; }; BOOST_IOSTREAMS_PIPABLE(basic_line_filter, 2) typedef basic_line_filter
line_filter; typedef basic_line_filter
wline_filter; } } // End namespaces iostreams, boost. #include
#endif // #ifndef BOOST_IOSTREAMS_LINE_FILTER_HPP_INCLUDED
line.hpp
Page URL
File URL
Prev
5/11
Next
Download
( 7 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.