IVFSNODE_SetDataBuffer help | developer.brewmp.com IVFSNODE_SetDataBuffer help | developer.brewmp.com

Developer

IVFSNODE_SetDataBuffer help

In reading the API description of IACTORCONTEXT_CreateString() it mentions that one can use IVFSNODE_SetDataBuffer (and SetDataBufferSize) on a String Node of zero size as an alternate machanism for providing string data. Has anyone done this or can anyone provide an example? I've tried, but my trig seems incapable of reading string data that I set in this way. If I create a Node by providing a length in the CreateString and then IVFSNODE_SetData, it is fine. Using SetDataBuffer, I can even to a GetDataBuffer and see that the node is supposed to be pointing to the right mem address and that a get on the node type is a string, but I can't figure out why it's not showing up to the trig.

e.g.

//This works...
IVfsNode*content;
AECHAR* contentString;
int contentLength;

//do stuff here to populate contentString and size it

IACTORCONTEXT_CreateString( context, KContent, 256, (IVfsContainer*)container, 0, &content);
IVFSSTRUCTCONTAINER_AddChild(container, content);
IVFSNODE_SetData( content, NULL, AEEIID_VFS_STRING_DATA, (const void*)contentString, contentLength );

//This doesn't work...
IVfsNode*contentBuf;
AECHAR* contentString;
int contentLength;

//do stuff here to populate contentString and size it

IACTORCONTEXT_CreateString( context, KContent, 0, (IVfsContainer*)container, 0, &contentBuf); //zero size b/c using setdatabuffer
IVFSSTRUCTCONTAINER_AddChild(container, contentBuf);
IVFSNODE_SetDataBuffer( contentBuf, (void*)contentString);
IVFSNODE_SetDataBufferSize( contentBuf, contentLength );

Thanks in advance.

Now I met this problem too, have you solve the problem?

Now I met this problem too, have you solve the problem?

:( No, I did not find a solution. Has anyone successfully done this?

:( No, I did not find a solution. Has anyone successfully done this?