spix icon indicating copy to clipboard operation
spix copied to clipboard

Escape character for '/' as a directory seperator?

Open MelodicsVincent opened this issue 3 years ago • 2 comments

With the existing implementation of TestServer.cpp, would it be possible to search for a path that contains a '/' without treating the '/' as a directory seperator? e.g. 'mainWindow/1/2' where '1/2' is the object to find

If not, what modifications could be done to the existsAndVisible function?

MelodicsVincent avatar Nov 18 '21 03:11 MelodicsVincent

Currently this is not possible as spix simply splits the path at any '/' without the option for an escape character. This shouldn't be too difficult to fix though.

The conversion from string to spix' path object happens here and would just need to deal with escape characters: https://github.com/faaxm/spix/blob/a88161b380f0d094d1bc7a0b58175b2c4d1d53b1/lib/src/Data/ItemPath.cpp#L21-L32 And then one would also have to adapt the inverse conversion back to strings: https://github.com/faaxm/spix/blob/a88161b380f0d094d1bc7a0b58175b2c4d1d53b1/lib/src/Data/ItemPath.cpp#L49-L61

Last but not least, the unit tests would have to be extended: https://github.com/faaxm/spix/blob/a88161b380f0d094d1bc7a0b58175b2c4d1d53b1/lib/tests/unittests/Data/ItemPath_test.cpp#L11

faaxm avatar Nov 19 '21 10:11 faaxm

nice!

reubenpuketapu avatar Nov 24 '21 23:11 reubenpuketapu