spix
spix copied to clipboard
Escape character for '/' as a directory seperator?
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?
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
nice!