コード例 #1
0
ファイル: data.cpp プロジェクト: kthielen/ww
linedb::LineCol linedb::pos(nat i) const {
	nats::const_iterator np = std::lower_bound(this->lp.begin(), this->lp.end(), i);
	nat k = std::distance(this->lp.begin(), np);
	
	if (k == 0) {
		return LineCol(1, i + 1);
	} else if (np == this->lp.end()) {
		return LineCol(this->lp.size() + 1, i - this->lp[this->lp.size() - 1]);
	} else {
		return LineCol(1 + k, i - *(np - 1));
	}
}
コード例 #2
0
LineCol CCrystalScriptStream::const_iterator::GetPosition() const
{
    return LineCol(_nLine, _nChar);
}