I want to have a user setting that is passed in as a string the string reprsents
a list of folders along with some 'meta' data. The folders passed in will be
used cross platform, but I will convert seperators / and \ for the platfrom I am
running on.The list of folders will be used to search for all sub folders in
them
Indavidual folders will be space deliminated, eg
foo bar foobar/foo foobar/bar
the '^' befor a foldername will be used to seperate any meta data for the
next one folder, though it should not be space deliminated. If it where, the
meta tag would apply to no folder, and the folder you intended to apply it to
will have no meta data at all.
if your folder name needs to littrally start with '^', with any other meta data
such as '!nix~^myOddFolder' you can start with the '~' character, this will
mean that anything between the initial '~' and the first '^' will taken as
of folder name
~!nix~^win_^myOddFolder => !nix~^win_myOddFolder
Note that you do not need to worry about escpaing meta data if you never use the
'^' symbol, or if this parts that look like meta data come after the first '^'.
eg
^does_not_need_escaping
however, in this example, the initial '^' will not be counted as part of the
folder name. As the anything upto and including the first '^' is removed as meta
data, if you want to start your folder name with a '^' you can simple write '^^'
there is no need use '~^^'
It is also worth noteing that you can combine meta data with escaping, but you
should not need to. eg
you might be | but can just | to match
tempted to write | write | the folder
| |
!win~nix^/foobar | !win^nix/foobar | nix/foobar
A '!' will indicate an exlusion, the folder and all sub folders will not be
searched, eg
foobar !^foobar/foo foobar/bar
This will search foobar, and foorbar/bar (it did not need to be expliciatley
stated) but it will not search foobar/foo.
A tag can be applied to only certain platforms by using a 'code', either 'win',
'nix' or 'osx'
'win' => Windows
'nix' => Linux and Unix like OS
'osx' => macs/osx
Only one platform tag can be used, and the last one used will be the one that is
taken. These can also be combined with '!' (so if you want a folder on two
platforms, simply exclude it from the third), eg
!win^foobar/not_windows winosx^only_used_on_osx !winosx^not_osx
In order to do 32/64 bit only folders, you can also use two tags
'x86' => 32 bit platforms
'x64' => 64 bit platforms
like OS specific tags, these only one can be ineffect, and the last one used
takes preccedence. They can be combined along with the OS tags. eg
x64^all_OSs/only_64_bit !x86win^not_32_bit_nor_Windows
As you can see in this last exxample, the negation works applies to all the tags
. The 'x86win' part says 'if on 32 bit Windows...' and the '!' says do not
search in this folder. If you wanted Windows AND not 32 but, you should say
'x64win'
As a final point, it is important to consider how the pattern will be
interpreted. When it is passed, it will be reduced to two lists, one for folders
to search and one for folders to exlucde from searching. As the string is
passed, any details that relate to other platforms are droped, leaving only the
folders that are intended for this platform.
For example, if you have the folder string 'foo/bar !win^foo win^bar', on
platforms other then Windows, this will search through no folders, as the
'!win^foo' will exclude the 'foo/bar' that you might think would be searched by
all platforms.