Essentially, this pull request changes the behavior of how Tini parses configuration files. Tini can now accept \as a special escape char. This was specifically needed because domain names for example couldn't be represented as they had dots in them. To implement this, all I had to essentially change was to make tiniutils::splitaccept a third optional parameter escape, which makes the split implementation skip over it if it happens to match with the delimiter.
Some small changes had to also be made on TiniValidator to make it also recognize the escaped chars as valid. In TiniNode, S_ALPHA was changed to S_VALID as this broadened scope allows more than just alphabetical chars in the context switch.
Other changes include introducing namespaces to TiniUtils, primarily to implement testing capability for namespaces and also to not confuse people reading the code as to where for example the split function originates from, as it's used in more places, than just Tini*.cpp. Additionally, the regex in testgen was changed to accomodate for tests to namespaces as well.
Tests were implemented specifically for the splitfunction and it appears to behave as expected.
Essentially, this pull request changes the behavior of how Tini parses configuration files. Tini can now accept
\
as a special escape char. This was specifically needed because domain names for example couldn't be represented as they had dots in them. To implement this, all I had to essentially change was to maketiniutils::split
accept a third optional parameterescape
, which makes the split implementation skip over it if it happens to match with the delimiter.Essentially it functions like:
Which allows
TiniTree
to parse hostname urls on the map context switches literally.So the configuration file can now accept such
Host
:Some small changes had to also be made on
TiniValidator
to make it also recognize the escaped chars as valid. InTiniNode
,S_ALPHA
was changed toS_VALID
as this broadened scope allows more than just alphabetical chars in the context switch.Other changes include introducing namespaces to
TiniUtils
, primarily to implement testing capability for namespaces and also to not confuse people reading the code as to where for example thesplit
function originates from, as it's used in more places, than justTini*.cpp
. Additionally, the regex in testgen was changed to accomodate for tests to namespaces as well.Tests were implemented specifically for the
split
function and it appears to behave as expected.This pull request closes #26