|
Boost Users : |
From: Eric Niebler (eric_at_[hidden])
Date: 2005-12-22 11:39:43
Markus Schöpflin wrote:
> Bronek Kozicki wrote:
>
>>Is it possible to write parser of binary data (ie. NULL is just some
>>value, not string delimiter) using Spirit or Xpressive? Did anyone
>>actualy tried it?
>
>
> There is a binary parser sample in
> "libs/spirit/example/intermediate/ipv4.cpp" so I would say the answer is
> yes for spirit. And no, I didn't try it myself...
>
This is true also for xpressive, which works with iterators and gives no
special meaning to NULL characters. xpressive can also be used to parse
non-character data, such as arrays of integers. Just use the
null_regex_traits in xpressive/traits/null_regex_traits.hpp. This is
documented at http://tinyurl.com/bw5pk
HTH,
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net