HyppoVFSItem
[Hyppocampus VFS]


Detailed Description

A HyppoVFSItem is a proxy to a single item stored in the filesystem. It means it can be a file, but also a contact, a URL, or any other kind of atomic information handled by the system.

Each item is identified by an ID unique on the whole filesystem, and has a list of assigned metadata, each of them is abstracted with a HyppoVFSMetadata object.

An item handled via HyppoVFSItem can be observed (see Observers ) by addictions, deletions and modifications of assigned metadata. Please note that contents of an item of the "file" type are also considered as metadata.


Data Structures

struct  _HyppoVFSItem
struct  _HyppoVFSItemClass

Defines

#define HYPPO_ITEM_ID_TYPE   G_TYPE_UINT64

Functions

GType hyppo_vfs_item_get_type ()
HyppoVFSItemhyppo_vfs_item_new (HyppoItemID id)
HyppoVFSItemhyppo_vfs_item_create ()
HyppoItemID hyppo_vfs_item_get_id (HyppoVFSItem *item)
HyppoVFSMetadatahyppo_vfs_item_get_metadata (HyppoVFSItem *item, HyppoMetadataID metaid)
const GList * hyppo_vfs_item_get_all_metadata (HyppoVFSItem *item)
HyppoVFSMetadatahyppo_vfs_item_set_metadata (HyppoVFSItem *item, HyppoMetadataID metaid,...)
void hyppo_vfs_item_remove_metadata (HyppoVFSItem *item, HyppoMetadataID metaid)
GIOChannel * hyppo_vfs_item_open (HyppoVFSItem *item)
void hyppo_vfs_item_remove (HyppoVFSItem *item)


Define Documentation

#define HYPPO_ITEM_ID_TYPE   G_TYPE_UINT64

FIXME Comment


Function Documentation

GType hyppo_vfs_item_get_type (  ) 

Gets the GType for the HyppoVFSItem object

Returns:
The newly assigned GType

HyppoVFSItem* hyppo_vfs_item_new ( HyppoItemID  id  ) 

Creates a proxy for an existing metadata on the filesystem

Parameters:
id Item ID for the element to retrive
Returns:
A new proxy for the desired item, or NULL if the required ID doesn't exists

HyppoVFSItem* hyppo_vfs_item_create (  ) 

Creates a new item on the filesystem

Returns:
A reference to the proxy pointing the newly created item

Here is a problem with overlap of names: due the fact in Hyppocampus names have not to be unique (discriminants are ID automatically assigned), referring here directly the required name it's probable to match an existing name and overwriting an existing valid file. So, when creating a new item, I assign him a random name checking for uniqueness, and when found change the metadata for the filename

HyppoItemID hyppo_vfs_item_get_id ( HyppoVFSItem item  ) 

FIXME Comment

HyppoVFSMetadata* hyppo_vfs_item_get_metadata ( HyppoVFSItem item,
HyppoMetadataID  metaid 
)

Retrives a metadata assigned to a specified item

Parameters:
item HyppoVFSItem for which search the metadata
metaid Metadata ID to look for
Returns:
Rappresentation of the desired metadata. It is a direct reference to internal structures for HyppoVFSItem, do not alterate it outside dedicated routines. If no metadata are found, NULL is returned

const GList* hyppo_vfs_item_get_all_metadata ( HyppoVFSItem item  ) 

Builds the complete list of metadata for an item on the filesystem

Parameters:
item HyppoVFSItem for which build the list of metadata
Returns:
List of metadata assigned to the specified item. Elements into the list are direct links to the internal structure of the HyppoVFSItem, please do not alterate their contents. The list have to be freed only with g_list_free()

Todo:
Better control into array iteration, check for iter position

HyppoVFSMetadata* hyppo_vfs_item_set_metadata ( HyppoVFSItem item,
HyppoMetadataID  metaid,
  ... 
)

FIXME Comment

void hyppo_vfs_item_remove_metadata ( HyppoVFSItem item,
HyppoMetadataID  metaid 
)

Removes a metadata from a HyppoVFSItem

Parameters:
item HyppoVFSItem from which remove the metadata
metaid Metadata ID for the attribute to remove

Todo:
Optimizable using a special function for get the metadata and obtain immediately the sequence iter

GIOChannel* hyppo_vfs_item_open ( HyppoVFSItem item  ) 

Open a file descriptor on the specified item

Parameters:
item The HyppoVFSItem to open
Returns:
The file descriptor wrapper into a GIOChannel, or NULL if an error occurs while opening

Todo:
Verify type of item before open it. Some type of items are virtual, and have no contents

void hyppo_vfs_item_remove ( HyppoVFSItem item  ) 

Removes an item from the filesystem. Please refere Observers to read about implication of the items deletion


Generated on Sun Feb 17 21:39:03 2008 for LibHyppo by  doxygen 1.5.5