Boost logo

Boost :

Subject: Re: [boost] Is Boost interested in the Boost-based Base64 library
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-06-09 19:14:40


Denis Shevchenko wrote:
>> So I think a much more interesting and useful project would be:
>>
>> "an optimally fast, character range processing library which can be
>> used construct a wide variety of character processing algorithms by
>> composition of more primitive concepts in a regular way." Examples
>> include base64, ... and generation of custom code_convert facets
>> for io_streams..
>>
>> Robert Ramey
>
> I understand you, Robert. You're talking about flexible (and probably
> big) library, and I'm talking about the utility. But this utility
> solves one concrete common task, and do it (IMHO) good. This can be
> compared with boost::mem_fn or boost::lexical_cast - do one concrete
> task and do it well.
> My solution is a single .hpp file, and it can be part of... hmmm...
> Boost.Utility, for example, or even part of Boost.Serialization.

>> Does your interface support ranges without your having shown it? Is
>> there output iterator support?
>>
>> Rob Stewart robert.stewart_at_[hidden]
>
> Sorry, Rob, perhaps I misunderstood your question.
>
> In fact, now is the main question about fundamental interest to
> Boost-based base64 ready-to-use solution, but not about implementation
> details. Of course, details will be discussed.

I think you'd find it interesting to see how the serialization library does
it.

../boost/archive/iterators/base64_from_binary
../boost/archive/iterators/binary_from_base64

These provide a pair of iterators which can be used with any
algorithm which take a pair of iterators - ie most of of the standard ones.
It's much more than an implementation detail - it's a whole different
way of looking at the problem. It works with all of lot's of overstuff.
Of course there's nothing that prevents one from creating a wrapper
which provides a more convenient interface for many situations. So I
would encourage you to think bigger:

a) take a look at dataflow iterators in the boost serializaiton library
b) take a look at range iterators. (this uses similar technique but is
much more general).
c) craft a more general - text processing toolkit which includes as
examples a convenient wrapper for base64 conversion, also
I would like to see it include examples for implementing code_cvt
facets.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk