Beispiel #1
0
/**
 * ggit_diff_line_get_text:
 * @line: a #GgitDiffLine.
 *
 * Get the content of the diff line as UTF-8 encoded text.
 *
 * Returns: the content in utf-8 encoding.
 *
 **/
const gchar *
ggit_diff_line_get_text (GgitDiffLine *line)
{
	g_return_val_if_fail (line != NULL, NULL);

	if (line->text == NULL)
	{
		line->text = ggit_convert_utf8 (line->content,
		                                line->content_len,
		                                line->encoding);
	}

	return line->text;
}
Beispiel #2
0
/**
 * ggit_diff_line_get_text:
 * @line: a #GgitDiffLine.
 *
 * Get the content of the diff line as UTF-8 encoded text.
 *
 * Returns: the content in utf-8 encoding.
 *
 **/
const gchar *
ggit_diff_line_get_text (GgitDiffLine *line)
{
	g_return_val_if_fail (line != NULL, NULL);

	if (line->text == NULL)
	{
		const gchar *content;
		gsize content_len;

		content = g_bytes_get_data (line->content, &content_len);
		line->text = ggit_convert_utf8 (content,
		                                content_len,
		                                line->encoding);
	}

	return line->text;
}