本文整理汇总了C++中EvDocumentClass::load_stream方法的典型用法代码示例。如果您正苦于以下问题:C++ EvDocumentClass::load_stream方法的具体用法?C++ EvDocumentClass::load_stream怎么用?C++ EvDocumentClass::load_stream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvDocumentClass
的用法示例。
在下文中一共展示了EvDocumentClass::load_stream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* ev_document_load_stream:
* @document: a #EvDocument
* @stream: a #GInputStream
* @flags: flags from #EvDocumentLoadFlags
* @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: (allow-none): a #GError location to store an error, or %NULL
*
* Synchronously loads the document from @stream.
* See ev_document_load() for more information.
*
* Returns: %TRUE if loading succeeded, or %FALSE on error with @error filled in
*
* Since: 3.6
*/
gboolean
ev_document_load_stream (EvDocument *document,
GInputStream *stream,
EvDocumentLoadFlags flags,
GCancellable *cancellable,
GError **error)
{
EvDocumentClass *klass;
g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
g_return_val_if_fail (G_IS_INPUT_STREAM (stream), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
klass = EV_DOCUMENT_GET_CLASS (document);
if (!klass->load_stream) {
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Backend does not support loading from stream");
return FALSE;
}
if (!klass->load_stream (document, stream, flags, cancellable, error))
return FALSE;
ev_document_setup_cache (document);
return TRUE;
}