Before I re-invent the wheel, I would like to know if anyone has previously created a library to parse and/or create a Perforce File Specification (http://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html) in some library either in C++ or C#. I'd like to perform various operations like:
- Optimize client spec (remove unneeded -/+ that are superfluous) and sort it
- Create a client spec based on 'have' list
- Add/remove new directories or file lists
The motivation is to make managing client specs automatic through a front-end tool. There is a decent editor in P4V, but in most cases I can generate the client spec for people in my company to make things easier.
One example would be to pass in a client spec something like:
//depot/Release/HEAD/... //joel.van.eenwyk_dev/HEAD/... -//depot/Release/HEAD/Test/... //joel.van.eenwyk_dev/HEAD/Test/... -//depot/Release/HEAD/Docs/... //joel.van.eenwyk_dev/HEAD/Docs/... //depot/Release/HEAD/Docs/... //joel.van.eenwyk_dev/HEAD/Docs/...
And it would automatically optimize it to:
//depot/Release/HEAD/... //joel.van.eenwyk_dev/HEAD/... -//depot/Release/HEAD/Test/... //joel.van.eenwyk_dev/HEAD/Test/...
I'm looking for an open-source solution that does not cost anything. My target platform is Windows, but happy to port code over from other platforms.