(0 . 0)(1 . 54)
6594 #ifndef JSON_SPIRIT_ERROR_POSITION
6595 #define JSON_SPIRIT_ERROR_POSITION
6596
6597 // Copyright John W. Wilkinson 2007 - 2009.
6598 // Distributed under the MIT License, see accompanying file LICENSE.txt
6599
6600 // json spirit version 4.03
6601
6602 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6603 # pragma once
6604 #endif
6605
6606 #include <string>
6607
6608 namespace json_spirit
6609 {
6610 // An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
6611 // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
6612 // functions that return a bool.
6613 //
6614 struct Error_position
6615 {
6616 Error_position();
6617 Error_position( unsigned int line, unsigned int column, const std::string& reason );
6618 bool operator==( const Error_position& lhs ) const;
6619 unsigned int line_;
6620 unsigned int column_;
6621 std::string reason_;
6622 };
6623
6624 inline Error_position::Error_position()
6625 : line_( 0 )
6626 , column_( 0 )
6627 {
6628 }
6629
6630 inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
6631 : line_( line )
6632 , column_( column )
6633 , reason_( reason )
6634 {
6635 }
6636
6637 inline bool Error_position::operator==( const Error_position& lhs ) const
6638 {
6639 if( this == &lhs ) return true;
6640
6641 return ( reason_ == lhs.reason_ ) &&
6642 ( line_ == lhs.line_ ) &&
6643 ( column_ == lhs.column_ );
6644 }
6645 }
6646
6647 #endif