BClipboard files format

I’m implementing clipboard support for my apps and one of the things it expects to be able to do is read/write a list of files to the clipboard. When I copy 3 files in the file manager and then enumerate the values in the data BMessage I get:

‘m3_2638098’ type=LONG, count=1
‘r3_2638098’ type=RREF, count=1
‘m3_2638107’ type=LONG, count=1
‘r3_2638107’ type=RREF, count=1
‘m3_2638104’ type=LONG, count=1
‘r3_2638104’ type=RREF, count=1

My question is… is there a reference for what is actually going on there?
Are the names of the variables important?
What is the definition of ‘LONG’ and ‘RREF’?
Seems like each file has both a LONG and RREF…

Ooo ‘RREF’ is B_REF_TYPE… which is an entry_ref…

The ‘LONG’ has the 4cc value ‘Tcsl’… which doesn’t seem to make any immediate sense.

Ok so I’ve got a working “get” implementation that returns a list of file names on the clipboard. By getting the entry_ref and then converting to a BPath and finally to a string with the full path.

However going from an array of file names (full path) to the clipboard is more challenging. Ideally there’d be a helper function or class to do that. But I’m assuming there isn’t right?

1 Like

Did you had a look at Clipdinger souces? Perhaps could you find some hints…

1 Like

You can create a BEntry from a path and if needed convert it to an entry_ref using GetRef. Then you can use BMessage::AddEntry to add it to the clipboard message

1 Like