예제 #1
0
std::set<TextQuery::line_no>
NotQuery::eval( const TextQuery& file ) const
{
  std::set<TextQuery::line_no> has_val = query.eval( file );
  std::set<line_no> ret_lines;

  for( TextQuery::line_no n = 0; n != file.size(); ++n )
    if ( has_val.find( n ) == has_val.end() )
      ret_lines.insert( n );
  return ret_lines;
}
예제 #2
0
파일: Query.cpp 프로젝트: bondyuan/exercise
std::set<TextQuery::line_no> NotQuery::eval(const TextQuery &obj_TextQuery) const
{
	std::set<TextQuery::line_no> has_val = query.eval(obj_TextQuery);
	std::set<TextQuery::line_no> ret_line;
	for (int i = 0; i != obj_TextQuery.size(); ++i)
	{
		if (has_val.find(i) == has_val.end())
			ret_line.insert(i);
		return ret_line;
	}

}
예제 #3
0
파일: Query.cpp 프로젝트: yuandaxing/utils
std::set<TextQuery::line_no>
NotQuery::eval(const TextQuery& tq) const {
	std::set<TextQuery::line_no> v = query.eval(tq);
	std::set<line_no> ret;
	for( TextQuery::line_no n = 0 ; n != tq.size() ; n++ )
	{
		if( v.find(n) == v.end() )
		{
			ret.insert(n);
		}
	}
	return ret;
}
예제 #4
0
set<TextQuery::line_no>
NotQuery::eval(const TextQuery& file) const
{
	// virtual call through the Query handle to eval
	set<TextQuery::line_no> has_val = query.eval(file);
	set<line_no> ret_lines;
	// for each line in the input file, check whether that line is	in has_val
		// if not, add that line number to ret_lines
		for (TextQuery::line_no n = 0; n != file.size(); ++n)
			if (has_val.find(n) == has_val.end())
				ret_lines.insert(n);
	return ret_lines;
}