Developer

API Reference

IVFSNODE_SetData()

deprecated
Items marked as deprecated have been replaced by a more powerful, alternative feature. Deprecated interfaces include a reference to the replacement interface, which should be used for all new application development. Deprecated features are still supported for backward compatibility, but should be avoided when developing new applications.
Brew Release
Brew MP 1.0.2
See Also
IVFSNODE_GetData() IVFSNODEMODEL_SetNodeData()
Description
This method may be used to set the data held by an IVFSNODE. Please note that many Vfs nodes are read-only, and that this call will return EFAILED if used on them.
Parameters
  • node
    []:
    Pointer to the IVfsNode interface object
  • path
    []:
    The remainder of the path to the desired node.
  • type
    []:
    The type of data presented by pObj. The model should check if that is a supported data type.
  • pObj
    []:
    The address from which the data may be copied.
  • pSize
    []:
    The size of data held at pObj
Interface
IVFSNODE
Prototype
   int IVFSNODE_SetData( IVfsNode * node, VfsPath path, AEECLSID type, const void * pObj, int size )
Return
   SUCCESS - the call has been completed successfully.
   EMEMPTR - pObj is NULL
   EBADPARM - the size is incorrect for this type of data.
   EINVALIDFORMAT - The node does not handle data with class id 'type'
   EBUFFERTOOSMALL - The node's data space is too small to contain the presented data.
Side Effect
Nodes may be created (by IVfsCacheContainers) in order to satisfy this request. If a new interface pointer is stored into an interface node, the old interface is IBase_Release()d and the node AddRef()s the new interface pointer.
Comment

This is a complex function, best descibed by pseudocode.
First the path is checked. * If at the end of the path, then _this_ node should be set. * Otherwise: * if this node is a container, the call is passed on to the appropriate child node (one whose name matches path[0]) with the first element of the path stripped. * if this node is NOT a container, the call fails with ENOSUCH

If type is NOT a type handled by this node, then the call fails with EINVALIDFORMAT
If the node contains integer or interface data, and the size value is incorrect (i.e. not sizeof(int) or sizeof(IBase*) as appropriate), then EBADPARM is returned.
If the node contains string or byte data, and the data being set is larger than the storage space allocated in the node, then EBUFFERTOOSMALL is returned. The data buffer size may be read with the IVFSNODE_BufferSize() call.
The data accepted depends on the type of data held by the node:
   Data        type                       pObj cast from Code snippet
   ----------- -------------------------- -------------- -------------------------------------
   integer     AEEIID_VFS_INTEGER_DATA    int *          int i; pObj = (const void*)&i;
   string      AEEIID_VFS_STRING_DATA     AECHAR *       AECHAR s[]; pObj = (const void*)&s[0];
   byte data   AEEIID_VFS_BYTE_DATA       uint8 *        uint8 d[]; pObj = (const void*)&d[0];
   interface   (interface id)             IBase **       IBase * p; pObj = (const void*)&p;

Note that this call COPIES data from the buffer supplied to internal storage within the addressed Vfs node.
SIGNAL type and container nodes have no data that can be set; this call would fail with EBADITEM.
  • Follow