libcsem
0.2
|
Go to the source code of this file.
Defines | |
#define | CSEM_NS_C_BEGIN |
#define | CSEM_NS_C_END |
Typedefs | |
typedef typedefCSEM_NS_C_BEGIN struct CSEM_Item | CSEM_Item |
Item object. | |
typedef struct CSEM_Property | CSEM_Property |
Property object defined with @itemprop of microdata, or defined with @property of RDFa Lite. | |
Enumerations | |
enum | CSEM_VALUE_TYPE { CSEM_VALUE_TYPE_STR = 0, CSEM_VALUE_TYPE_URL, CSEM_VALUE_TYPE_ITEM, CSEM_VALUE_TYPE_PROPERTY } |
Types of property value. More... | |
Functions | |
CSEM_Error | CSEM_Item_Create (CSEM_Item **item) |
Create an item object. | |
void | CSEM_Item_Dispose (CSEM_Item *item) |
Dispose an item object. | |
CSEM_Url * | CSEM_Item_GetId (CSEM_Item *item) |
Get the unique identification of the item. | |
CSEM_Error | CSEM_Item_SetId (CSEM_Item *item, const CSEM_Url *id, CSEM_Bool free) |
Set a unique identification of the item. | |
CSEM_List * | CSEM_Item_GetTypes (const CSEM_Item *item) |
Get the type values of the item. | |
CSEM_Error | CSEM_Item_SetTypes (CSEM_Item *item, const CSEM_List *types, CSEM_Bool free) |
Set type values of the item. | |
CSEM_List * | CSEM_Item_GetProperties (const CSEM_Item *item) |
Get properties of the item. | |
CSEM_Error | CSEM_Item_GetNamedPropertes (const CSEM_Item *item, const char *name, CSEM_List **properties) |
Get properties whose name is equal to the specified name. | |
CSEM_Error | CSEM_Item_AddProperty (CSEM_Item *item, CSEM_Property *property, CSEM_Bool changeParent) |
Add a property to the item. | |
CSEM_Error | CSEM_Property_Create (CSEM_Property **property, CSEM_List *names) |
Create a property object which has the specified property names. | |
void | CSEM_Property_Dispose (CSEM_Property *property) |
Dispose a property object. | |
CSEM_List * | CSEM_Property_GetNames (CSEM_Property *property) |
Get names of the property. | |
CSEM_Error | CSEM_Property_GetValues (CSEM_Property *property, CSEM_List **values, CSEM_List **valueTypes) |
Get values and the types of the values of the specified property. | |
CSEM_Error | CSEM_Property_AddValues (CSEM_Property *property, void *value, CSEM_VALUE_TYPE type) |
Add a value to the property. | |
CSEM_Error | CSEM_Properties_GetValues (CSEM_List *properties, CSEM_List **values, CSEM_List **valueTypes) |
Get values and the types of the values of the specified properties. | |
CSEM_Error | CSEM_Document_GetItems (CSEM_Document *doc, CSEM_List *types, CSEM_List **items) |
Get top-level items which have all of the specified types. |
#define CSEM_NS_C_BEGIN |
#define CSEM_NS_C_END |
typedef struct CSEM_Property CSEM_Property |
Property object defined with @itemprop of microdata, or defined with @property of RDFa Lite.
enum CSEM_VALUE_TYPE |
CSEM_Error CSEM_Document_GetItems | ( | CSEM_Document * | doc, |
CSEM_List * | types, | ||
CSEM_List ** | items | ||
) |
Get top-level items which have all of the specified types.
@itemtype of microdata or @typeof of RDFa Lite.
doc | [in]document object |
types | [in]type values |
items | [out]matched items (application need to free with CSEM_List_Dispose(items, CSEM_FALSE)) |
CSEM_Error CSEM_Item_AddProperty | ( | CSEM_Item * | item, |
CSEM_Property * | property, | ||
CSEM_Bool | changeParent | ||
) |
Add a property to the item.
item | [in]item |
property | [in]property to be added |
changeParent | [in]flag whether the property keeps current relationship with parent |
CSEM_Error CSEM_Item_Create | ( | CSEM_Item ** | item | ) |
Create an item object.
item | [out]item object to be created |
void CSEM_Item_Dispose | ( | CSEM_Item * | item | ) |
Dispose an item object.
item | [in]item object to be freed |
CSEM_Url* CSEM_Item_GetId | ( | CSEM_Item * | item | ) |
Get the unique identification of the item.
@itemid of microdata or @resource of RDFa Lite
item | [in]item |
CSEM_Error CSEM_Item_GetNamedPropertes | ( | const CSEM_Item * | item, |
const char * | name, | ||
CSEM_List ** | properties | ||
) |
Get properties whose name is equal to the specified name.
item | [in]item |
name | [in]name to be tested |
properties | [out]matched properties (applications need to free with CSEM_List_Dispose(properties, CSEM_FALSE)) |
CSEM_List* CSEM_Item_GetProperties | ( | const CSEM_Item * | item | ) |
Get properties of the item.
item | [in]item |
CSEM_List* CSEM_Item_GetTypes | ( | const CSEM_Item * | item | ) |
Get the type values of the item.
@itemtype of microdata or @typeof of RDFa Lite.
item | [in]item |
CSEM_Error CSEM_Item_SetId | ( | CSEM_Item * | item, |
const CSEM_Url * | id, | ||
CSEM_Bool | free | ||
) |
Set a unique identification of the item.
@itemid of microdata or @resource of RDFa Lite.
item | [in]item |
id | [in]id |
free | [in]if CSEM_TRUE is set, the old value is freed. |
CSEM_Error CSEM_Item_SetTypes | ( | CSEM_Item * | item, |
const CSEM_List * | types, | ||
CSEM_Bool | free | ||
) |
Set type values of the item.
@itemtype of microdata or @typeof of RDFa Lite.
item | [in]item |
types | [in]type values (not copied internally) |
free | [in]if CSEM_TRUE is set, the old values are freed. |
CSEM_Error CSEM_Properties_GetValues | ( | CSEM_List * | properties, |
CSEM_List ** | values, | ||
CSEM_List ** | valueTypes | ||
) |
Get values and the types of the values of the specified properties.
The type of values[n] is valueTypes[n].
properties | [in]properties |
values | [out]values (applications need to free with CSEM_List_Dispose(values, CSEM_FALSE)) |
valueTypes | [out]types of the values (applications need to free with CSEM_List_Dispose(valueTypes, CSEM_FALSE)) |
CSEM_Error CSEM_Property_AddValues | ( | CSEM_Property * | property, |
void * | value, | ||
CSEM_VALUE_TYPE | type | ||
) |
Add a value to the property.
property | [in]property |
value | [in]value |
type | [in]type of the value |
CSEM_Error CSEM_Property_Create | ( | CSEM_Property ** | property, |
CSEM_List * | names | ||
) |
Create a property object which has the specified property names.
@itemprop of microdata or @property of RDFa Lite.
property | [out]property object to be created |
names | [in]property names (not copied internally) |
void CSEM_Property_Dispose | ( | CSEM_Property * | property | ) |
Dispose a property object.
property | [in]property object to be freed |
CSEM_List* CSEM_Property_GetNames | ( | CSEM_Property * | property | ) |
Get names of the property.
property | [in]property object |
CSEM_Error CSEM_Property_GetValues | ( | CSEM_Property * | property, |
CSEM_List ** | values, | ||
CSEM_List ** | valueTypes | ||
) |
Get values and the types of the values of the specified property.
The type of values[n] is valueTypes[n].
property | [in]property |
values | [out]values |
valueTypes | [out]types of the values |