11 #ifndef _STRUS_ANALYZER_POSITION_HPP_INCLUDED
12 #define _STRUS_ANALYZER_POSITION_HPP_INCLUDED
13 #include "strus/base/stdint.h"
32 :m_seg(seg_),m_ofs(ofs_){}
34 #if __cplusplus >= 201103L
41 :m_seg(o.m_seg),m_ofs(o.m_ofs){}
45 int seg()
const {
return m_seg;}
47 int ofs()
const {
return m_ofs;}
63 return (m_seg == o.m_seg)
64 ? ((m_ofs < o.m_ofs) - (m_ofs > o.m_ofs))
65 : ((m_seg < o.m_seg) - (m_seg > o.m_seg));
69 return (m_seg == o.m_seg)
75 return (m_seg == o.m_seg && m_ofs == o.m_ofs);
79 return (m_seg == o.m_seg)
85 return (m_seg == o.m_seg)
Position()
Default constructor.
Definition: position.hpp:26
int seg() const
Get the position of the segment in the original source.
Definition: position.hpp:45
bool operator>(const Position &o) const
Definition: position.hpp:83
Position(int seg_, int ofs_)
Constructor.
Definition: position.hpp:31
Position(const Position &o)
Copy constructor.
Definition: position.hpp:40
bool operator==(const Position &o) const
Definition: position.hpp:73
int ofs() const
Get the byte position in the translated document segment (UTF-8)
Definition: position.hpp:47
int compare(const Position &o) const
Compare with another position.
Definition: position.hpp:61
void setOfs(int ofs_)
Set the byte offset in the segment.
Definition: position.hpp:55
bool operator<(const Position &o) const
Definition: position.hpp:77
void setSeg(int seg_)
Set the segment position.
Definition: position.hpp:50
Structure describing a position in a document source by segment and offset.
Definition: position.hpp:22
bool operator<=(const Position &o) const
Definition: position.hpp:67