![]() |
![]() |
![]() |
AppStream-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <appstream-glib.h> enum AsMarkupConvertFormat; enum AsMarkupConvertFlag; gchar * as_markup_convert_simple (const gchar *markup
,GError **error
); gchar * as_markup_convert (const gchar *markup
,AsMarkupConvertFormat format
,GError **error
); gchar * as_markup_convert_full (const gchar *markup
,AsMarkupConvertFormat format
,AsMarkupConvertFlag flags
,GError **error
); gboolean as_markup_validate (const gchar *markup
,GError **error
); gchar ** as_markup_strsplit_words (const gchar *text
,guint line_len
); gchar * as_markup_import (const gchar *text
,AsMarkupConvertFormat format
,GError **error
);
These functions are used internally to libappstream-glib, and some may be useful to user-applications.
typedef enum { AS_MARKUP_CONVERT_FORMAT_SIMPLE, AS_MARKUP_CONVERT_FORMAT_MARKDOWN, AS_MARKUP_CONVERT_FORMAT_NULL, /* Since: 0.5.2 */ AS_MARKUP_CONVERT_FORMAT_APPSTREAM, /* Since: 0.5.2 */ AS_MARKUP_CONVERT_FORMAT_HTML, /* Since: 0.5.11 */ } AsMarkupConvertFormat;
The format used when converting to or from AppStream descriptions.
typedef enum { AS_MARKUP_CONVERT_FLAG_NONE = 0, AS_MARKUP_CONVERT_FLAG_IGNORE_ERRORS = 1 << 0, } AsMarkupConvertFlag;
The flags used when converting descriptions from AppStream-style.
gchar * as_markup_convert_simple (const gchar *markup
,GError **error
);
Converts an XML description into a printable form.
|
the text to copy. |
|
A GError or NULL
|
Returns : |
a newly allocated NULL terminated string. [transfer full]
|
Since 0.1.0
gchar * as_markup_convert (const gchar *markup
,AsMarkupConvertFormat format
,GError **error
);
Converts an XML description into a printable form.
|
the text to copy. |
|
the AsMarkupConvertFormat, e.g. AS_MARKUP_CONVERT_FORMAT_MARKDOWN
|
|
A GError or NULL
|
Returns : |
a newly allocated NULL terminated string. [transfer full]
|
Since 0.3.5
gchar * as_markup_convert_full (const gchar *markup
,AsMarkupConvertFormat format
,AsMarkupConvertFlag flags
,GError **error
);
Converts an XML description into a printable form.
|
the text to copy. |
|
the AsMarkupConvertFormat, e.g. AS_MARKUP_CONVERT_FORMAT_MARKDOWN
|
|
the AsMarkupConvertFlag, e.g. AS_MARKUP_CONVERT_FLAG_IGNORE_ERRORS
|
|
A GError or NULL
|
Returns : |
a newly allocated NULL terminated string. [transfer full]
|
Since 0.3.5
gboolean as_markup_validate (const gchar *markup
,GError **error
);
Validates some markup.
|
the text to validate |
|
A GError or NULL
|
Returns : |
TRUE if the appstream description was valid |
Since 0.5.1
gchar ** as_markup_strsplit_words (const gchar *text
,guint line_len
);
Splits up a long line into an array of smaller strings, each being no longer
than line_len
. Words are not split.
|
the text to split. |
|
the maximum length of the output line |
Returns : |
lines, or NULL in event of an error. [transfer full]
|
Since 0.3.5
gchar * as_markup_import (const gchar *text
,AsMarkupConvertFormat format
,GError **error
);
Imports text and converts to AppStream markup.
|
the text to import. |
|
the AsMarkupConvertFormat, e.g. AS_MARKUP_CONVERT_FORMAT_SIMPLE
|
|
A GError or NULL
|
Returns : |
appstream markup, or NULL in event of an error. [transfer full]
|
Since 0.5.11