AsContext

AsContext — Context of an AppStream metadata document

Functions

Types and Values

Includes

#include <appstream.h>

Description

Contains information about the context of AppStream metadata, from the root node of the document. Instances of AsContext may be shared between AsComponent instances.

You usually do not want to use this directly, but use the more convenient AsMetadata instead.

See also: AsComponent, AsMetadata

Functions

as_format_kind_to_string ()

const gchar *
as_format_kind_to_string (AsFormatKind kind);

Converts the enumerated value to an text representation.

Parameters

kind

the AsFormatKind.

 

Returns

string version of kind

Since: 0.10


as_format_kind_from_string ()

AsFormatKind
as_format_kind_from_string (const gchar *kind_str);

Converts the text representation to an enumerated value.

Parameters

kind_str

the string.

 

Returns

a AsFormatKind or AS_FORMAT_KIND_UNKNOWN for unknown

Since: 0.10


as_format_version_to_string ()

const gchar *
as_format_version_to_string (AsFormatVersion version);

Converts the enumerated value to an text representation.

Parameters

version

the AsFormatKind.

 

Returns

string version of version

Since: 0.10


as_format_version_from_string ()

AsFormatVersion
as_format_version_from_string (const gchar *version_str);

Converts the text representation to an enumerated value.

Parameters

version_str

the string.

 

Returns

a AsFormatVersion. For unknown, the highest version number is assumed.

Since: 0.10


as_context_new ()

AsContext *
as_context_new (void);

Creates a new AsContext.

Returns

an AsContext.

[transfer full]


as_context_get_format_version ()

AsFormatVersion
as_context_get_format_version (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The AppStream format version.


as_context_set_format_version ()

void
as_context_set_format_version (AsContext *ctx,
                               AsFormatVersion ver);

Sets the AppStream format version.

Parameters

ctx

a AsContext instance.

 

ver

the new format version.

 

as_context_get_style ()

AsFormatStyle
as_context_get_style (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The document style.


as_context_set_style ()

void
as_context_set_style (AsContext *ctx,
                      AsFormatStyle style);

Sets the AppStream document style.

Parameters

ctx

a AsContext instance.

 

style

the new document style.

 

as_context_get_priority ()

gint
as_context_get_priority (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The data priority.


as_context_set_priority ()

void
as_context_set_priority (AsContext *ctx,
                         gint priority);

Sets the data priority.

Parameters

ctx

a AsContext instance.

 

priority

the new priority.

 

as_context_get_origin ()

const gchar *
as_context_get_origin (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The data origin.


as_context_set_origin ()

void
as_context_set_origin (AsContext *ctx,
                       const gchar *value);

Sets the data origin.

Parameters

ctx

a AsContext instance.

 

value

the new value.

 

as_context_get_locale ()

const gchar *
as_context_get_locale (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The active locale.


as_context_set_locale ()

void
as_context_set_locale (AsContext *ctx,
                       const gchar *value);

Sets the active locale.

Parameters

ctx

a AsContext instance.

 

value

the new value.

 

as_context_has_media_baseurl ()

gboolean
as_context_has_media_baseurl (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

TRUE if a media base URL is set.


as_context_get_media_baseurl ()

const gchar *
as_context_get_media_baseurl (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The media base URL.


as_context_set_media_baseurl ()

void
as_context_set_media_baseurl (AsContext *ctx,
                              const gchar *value);

Sets the media base URL.

Parameters

ctx

a AsContext instance.

 

value

the new value.

 

as_context_get_locale_all_enabled ()

gboolean
as_context_get_locale_all_enabled (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

TRUE if all locale should be parsed.


as_context_get_filename ()

const gchar *
as_context_get_filename (AsContext *ctx);

Parameters

ctx

a AsContext instance.

 

Returns

The name of the file the data originates from.


as_context_set_filename ()

void
as_context_set_filename (AsContext *ctx,
                         const gchar *fname);

Sets the file name we are loading data from.

Parameters

ctx

a AsContext instance.

 

fname

the new file name.

 

Types and Values

AS_TYPE_CONTEXT

#define AS_TYPE_CONTEXT (as_context_get_type ())

struct AsContextClass

struct AsContextClass {
	GObjectClass parent_class;
};

enum AsFormatStyle

There are a few differences between AppStream's metainfo files (shipped by upstream projects) and the collection metadata (shipped by distributors). The data source kind indicates which style we should process. Usually you do not want to set this explicitly.

Members

AS_FORMAT_STYLE_UNKNOWN

   

AS_FORMAT_STYLE_METAINFO

Parse AppStream upstream metadata (metainfo files)

 

AS_FORMAT_STYLE_COLLECTION

Parse AppStream metadata collections (shipped by software distributors)

 

enum AsFormatKind

Format of the AppStream metadata.

Members

AS_FORMAT_KIND_UNKNOWN

Unknown metadata format.

 

AS_FORMAT_KIND_XML

AppStream XML metadata.

 

AS_FORMAT_KIND_YAML

AppStream YAML (DEP-11) metadata.

 

AS_FORMAT_KIND_DESKTOP_ENTRY

XDG Desktop Entry data.

 

enum AsFormatVersion

Format version / API level of the AppStream metadata.

Members

AS_FORMAT_VERSION_V0_6

0.6

 

AS_FORMAT_VERSION_V0_7

0.7

 

AS_FORMAT_VERSION_V0_8

0.8

 

AS_FORMAT_VERSION_V0_9

0.9

 

AS_FORMAT_VERSION_V0_10

0.10

 

AS_FORMAT_VERSION_V0_11

0.11

 

AS_FORMAT_VERSION_V0_12

0.12

 

AS_CURRENT_FORMAT_VERSION

#define AS_CURRENT_FORMAT_VERSION AS_FORMAT_VERSION_V0_12

AsContext

typedef struct _AsContext AsContext;