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
/*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library Definition of the position_iterator and file_position templates http://www.boost.org/ Copyright (c) 2001-2008 Hartmut Kaiser. 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) =============================================================================*/ #if !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED) #define FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED #include
#include
#include
#include
#include
#include
#if BOOST_WAVE_SERIALIZATION != 0 #include
#endif // this must occur after all of the includes and before any code appears #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_PREFIX #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { namespace util { /////////////////////////////////////////////////////////////////////////////// namespace debug { // Used only when BOOST_ASSERT expands to something // make sure the string literal does not contain any escapes ('\\' just // before '\\', '\"' or '?') template
inline bool is_escaped_lit(StringT const &value) { typename StringT::size_type pos = value.find_first_of ("\\", 0); if (StringT::npos != pos) { do { if ('\\' == value[pos+1] || '\"' == value[pos+1] || '?' == value[pos+1]) { return true; } else { pos = value.find_first_of ("\\", pos+1); } } while (pos != StringT::npos); } return false; } /////////////////////////////////////////////////////////////////////////////// } // namespace debug /////////////////////////////////////////////////////////////////////////////// // // file_position // // A structure to hold positional information. This includes the filename, // line number and column number of a current token position. // /////////////////////////////////////////////////////////////////////////////// template
struct file_position { public: typedef StringT string_type; file_position() : file(), line(1), column(1) {} explicit file_position(string_type const& file_, int line_ = 1, int column_ = 1) : file(file_), line(line_), column(column_) { BOOST_ASSERT(!debug::is_escaped_lit(file)); } // accessors string_type const &get_file() const { return file; } unsigned int get_line() const { return line; } unsigned int get_column() const { return column; } void set_file(string_type const &file_) { file = file_; BOOST_ASSERT(!debug::is_escaped_lit(file)); } void set_line(unsigned int line_) { line = line_; } void set_column(unsigned int column_) { column = column_; } private: #if BOOST_WAVE_SERIALIZATION != 0 friend class boost::serialization::access; template
void serialize(Archive &ar, const unsigned int version) { using namespace boost::serialization; ar & make_nvp("filename", file); ar & make_nvp("line", line); ar & make_nvp("column", column); } #endif string_type file; unsigned int line; unsigned int column; }; template
bool operator== (file_position
const &lhs, file_position
const &rhs) { return lhs.get_column() == rhs.get_column() && lhs.get_line() == rhs.get_line() && lhs.get_file() == rhs.get_file(); } template
inline std::ostream & operator<< (std::ostream &o, file_position
const &pos) { o << pos.get_file() << ":" << pos.get_line() << ":" << pos.get_column(); return o; } typedef file_position
file_position_type; /////////////////////////////////////////////////////////////////////////////// // // position_iterator // // The position_iterator used by Wave is now based on the corresponding Spirit // type. This type is used with our own file_position though. The needed // specialization of the boost::spirit::position_policy class is provided // below. // /////////////////////////////////////////////////////////////////////////////// template
struct position_iterator : boost::spirit::position_iterator
{ typedef boost::spirit::position_iterator
base_type; position_iterator() { } position_iterator(IteratorT const &begin, IteratorT const &end, PositionT const &pos) : base_type(begin, end, pos) { } }; /////////////////////////////////////////////////////////////////////////////// } // namespace util } // namespace wave /////////////////////////////////////////////////////////////////////////////// #if SPIRIT_VERSION >= 0x1700 namespace spirit { /////////////////////////////////////////////////////////////////////////////// // // The boost::spirit::position_policy has to be specialized for our // file_position class // /////////////////////////////////////////////////////////////////////////////// template <> class position_policy
{ public: position_policy() : m_CharsPerTab(4) {} void next_line(boost::wave::util::file_position_type &pos) { pos.set_line(pos.get_line() + 1); pos.set_column(1); } void set_tab_chars(unsigned int chars) { m_CharsPerTab = chars; } void next_char(boost::wave::util::file_position_type &pos) { pos.set_column(pos.get_column() + 1); } void tabulation(boost::wave::util::file_position_type &pos) { pos.set_column(pos.get_column() + m_CharsPerTab - (pos.get_column() - 1) % m_CharsPerTab); } private: unsigned int m_CharsPerTab; }; /////////////////////////////////////////////////////////////////////////////// } // namespace spirit #endif // SPIRIT_VERSION >= 0x1700 } // namespace boost // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX #endif #endif // !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
file_position.hpp
Page URL
File URL
Prev
7/19
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.