示例#1
0
PostingStream::PostingStream(
		istream &in, size_t begin, size_t df, size_t end)
	: in(in), out(cout), begin(begin), end(end), current(begin), 
		baseDocID(0), df(df) {

	in.seekg(end);
	size_t skipsNum = util::codec.decode(in);
	// TODO: Skipping list may need delta codec.
	for (size_t i = 0; i < skipsNum; i ++) {
		skips.push_back(SkipEntry(in));
	}
}
示例#2
0
OP_STATUS WidgetCreator::SetWidgetData(const uni_char* widget)
{
	OpLineParser line ( widget );
	OpString8 type;
	OpString type16;
	
	if (SkipEntry(line, type16))
		return OpStatus::ERR_OUT_OF_RANGE;

	type.Set(type16);
	m_widget_type = GetWidgetTypeFromString ( type );

	if ( m_widget_type == OpTypedObject::UNKNOWN_TYPE )
		return OpStatus::OK;
	
	line.GetNextLanguageString ( m_text, &m_string_id );
	
	RETURN_IF_ERROR ( line.GetNextToken8 ( m_name ) );
	
	line.GetNextValue ( m_rect.x );
	line.GetNextValue ( m_rect.y );
	line.GetNextValue ( m_rect.width );
	line.GetNextValue ( m_rect.height );

	OpString8 resize;
	RETURN_IF_ERROR ( line.GetNextToken8 ( resize ) );
	m_resize_flags = GetResizeFlagsFromString ( resize );
	
	OpString8 end;
	RETURN_IF_ERROR ( line.GetNextToken8 ( end ) );
	m_end = end.CompareI ( "End" ) == 0;
	
	line.GetNextValue ( m_value );
	
	return OpStatus::OK;
}