
Gennaro Prota wrote:
Hi,
I had a summary look at the changes made to Boost.Inspect (since I last saw it) and noticed a few issues:
* the "*A*" marker is used either for broken links, invalid urls etc. *and* non-ASCII chars
That was fixed earlier this month, IIRC.
* "non-ASCII" itself looks like a misleading name: see the string gPunct, defined in ascii_check.cpp
* non portable (though widely portable :-)) code:
if ( c >= 'a' && c <= 'z' ) return false; if ( c >= 'A' && c <= 'Z' ) return false; if ( c >= '0' && c <= '9' ) return false;
That was mentioned in "[inspect] Hall of Shame plus non-ASCII characters" recently.
If there aren't problems with standard library support I'd suggest replacing the above with
if ( std::isalnum( static_cast< int >( c ), std::locale::classic() ) )
Similarly for the subsequent isspace-like tests
You need to read the discussion. isalnum isn't what we want for source files, and whatever we settle on isn't going to be locale dependent.
* again in ascii_check.cpp there's some scaffolding to get a line number from a file position; this is needed in other inspector classes as well, and is done much differently. I think it is worth unifying this part and make it available in one place
Yes. John Maddock has been asking that we pinpoint errors more precisely. --Beman