Re: IPv6 address parsing
Seth <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 07-12-17 12:32, Michael Powell wrote:
> And then, I'm not convinced Qi/Fusion could
> interpret that? I could be wrong,
Maybe you'll be more convinced when it's demonstrated (I think I did
this before):
https://wandbox.org/permlink/M12U5PEYcB8vnxIs
It's really just ~3 lines of code changed:
using ipv4_address = std::string; // much less useful representation
// ....
addr_ = raw[ octet_ >> '.' >> octet_ >> '.' >> octet_ >> '.' >>
octet_ ];
Note now that test fails:
// new capabilities - now fails due to stringly-typed comparison... :(
verify_parse(g, "1.014.0x7b.003:0", { { "1.12.123.3" }, 0 });
Pick your poison (why not go with the best and convert back to string if
you need it?)
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general