![]() |
![]() |
![]() |
AppStream-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <appstream-glib.h> enum AsProblemKind; AsProblem * as_problem_new (void
); const gchar * as_problem_kind_to_string (AsProblemKind kind
); AsProblemKind as_problem_get_kind (AsProblem *problem
); guint as_problem_get_line_number (AsProblem *problem
); const gchar * as_problem_get_message (AsProblem *problem
); void as_problem_set_kind (AsProblem *problem
,AsProblemKind kind
); void as_problem_set_line_number (AsProblem *problem
,guint line_number
); void as_problem_set_message (AsProblem *problem
,const gchar *message
);
Problems have a unlocalized message and also contain a line number and kind.
See also: AsApp
typedef enum { AS_PROBLEM_KIND_UNKNOWN, AS_PROBLEM_KIND_TAG_DUPLICATED, AS_PROBLEM_KIND_TAG_MISSING, AS_PROBLEM_KIND_TAG_INVALID, AS_PROBLEM_KIND_ATTRIBUTE_MISSING, AS_PROBLEM_KIND_ATTRIBUTE_INVALID, AS_PROBLEM_KIND_MARKUP_INVALID, AS_PROBLEM_KIND_STYLE_INCORRECT, AS_PROBLEM_KIND_TRANSLATIONS_REQUIRED, AS_PROBLEM_KIND_DUPLICATE_DATA, AS_PROBLEM_KIND_VALUE_MISSING, AS_PROBLEM_KIND_URL_NOT_FOUND, AS_PROBLEM_KIND_FILE_INVALID, AS_PROBLEM_KIND_ASPECT_RATIO_INCORRECT, AS_PROBLEM_KIND_RESOLUTION_INCORRECT, } AsProblemKind;
The problem type.
Type invalid or not known | |
A tag is duplicated | |
A required tag is missing | |
A tag value is invalid | |
A required attribute is missing | |
An attribute is invalid | |
The XML markup is invalid | |
Style guidelines are incorrect | |
Translations are required | |
Some data is duplicated | |
A value is required | |
The URL is not found | |
The file is invalid | |
The image aspect ratio is wrong | |
The image resolution is wrong |
AsProblem * as_problem_new (void
);
Creates a new AsProblem.
Returns : |
a AsProblem. [transfer full] |
Since 0.1.4
const gchar * as_problem_kind_to_string (AsProblemKind kind
);
Converts the enumerated value to an text representation.
|
the AsProblemKind. |
Returns : |
string version of kind
|
Since 0.1.4
AsProblemKind as_problem_get_kind (AsProblem *problem
);
Gets the problem kind.
|
a AsProblem instance. |
Returns : |
a AsProblemKind, e.g. AS_PROBLEM_KIND_TAG_MISSING
|
Since 0.1.4
guint as_problem_get_line_number (AsProblem *problem
);
Gets the line number of the problem if known.
|
a AsProblem instance. |
Returns : |
a line number, where 0 is unknown |
Since 0.1.4
const gchar * as_problem_get_message (AsProblem *problem
);
Gets the specific message for the problem.
|
a AsProblem instance. |
Returns : |
the message |
Since 0.1.4
void as_problem_set_kind (AsProblem *problem
,AsProblemKind kind
);
Sets the problem kind.
|
a AsProblem instance. |
|
the AsProblemKind. |
Since 0.1.4
void as_problem_set_line_number (AsProblem *problem
,guint line_number
);
Adds an line_number to the problem.
|
a AsProblem instance. |
|
a guint instance. |
Since 0.1.4