Example #1
0
static ArvDomDocument *
arv_dom_document_new_from_file (GFile *file, GError **error)
{
	ArvDomDocument *document;
	gsize size = 0;
	char *contents = NULL;

	if (!g_file_load_contents (file, NULL, &contents, &size, NULL, error))
		return NULL;

	document = arv_dom_document_new_from_memory (contents, size, error);

	g_free (contents);

	return document;
}
Example #2
0
ArvGc *
arv_gc_new (ArvDevice *device, const void *xml, size_t size)
{
	ArvDomDocument *document;
	ArvGc *genicam;

	document = arv_dom_document_new_from_memory (xml, size, NULL);
	if (!ARV_IS_GC (document)) {
		if (document != NULL)
			g_object_unref (document);
		return NULL;
	}

	genicam = ARV_GC (document);
	genicam->device = device;

	return genicam;
}