In the existing code, there are a few "reasons" for a certain failure case. These "reasons" are #defined as follows:
#define STRING_NOT_FOUND (1 << 0)
#define STRING_INVALID (1 << 1)
#define STRING_TOO_LARGE (1 << 2)
...etc
These are set using function setFailureReason(int reason);
What is the advantage in using shift operator while defining these constants as compared to using numbers, as shown below:
#define STRING_NOT_FOUND 1
#define STRING_INVALID 2
#define STRING_TOO_LARGE 4