Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-09-17 17:40:39


Pavel Vozenilek wrote:
>"Reece Dunn" wrote:
>
> > Cascading Style Sheets (CSS) are a web standard
> > [http://www.w3.org/Style/CSS/] used for controlling how HTML tags are
> > displayed to different devices (screen, printer and speech).
> >
> > It should be possible to provide the ability to save/load styling
>to/from
>a
> > file and allow copying of style objects, e.g.:
>Wouldn't it be easier (for user) to specify
>template-like file (HTML + some marks)
>and the library would fill in marked areas with data?

The question is how to process this file to extract the default formatting
information.

>HTML-like templates would be easy to create
>and verify. The C++ code won't need to contain
>complex embedded CCS. Mistakes in template
>could be handled gracefully. Missing template
>could be handled too.

Sure. However, you would probably need a Spirit grammar to process it,
adding a dependancy and making the code more complex.

>When I want debug dump the last thing I need
>is playing with subtlety of another language.

If you want a debug dump, you can output the STL container directly:

   std::cout << "vector = " << vec << '\n';

The CSS stuff would only be relevant for the default formatting. Custom
formatting works in pretty much the same way as described in the docs (with
the name changes).

The proposed CSS syntax behaves like Phoenix/Fusion in Boost.Spirit, using
expression templates, e.g.:

   std::cout
      << css::element( "pair" )
           [
              css::attribute( "separator" ) = " = "
           ]
      << io::object( _pair ) << '\n';

so this isn't another language. I was using HTML+CSS as a model for
implementing the styling here, showing how the concepts cross over.

That said, getting this working would be developer investment, compile time,
run-time and memory intensive, especially for more complex styling, whereas
I already have a version up and running that allows you to control default
styling for global decorators on a stream.

Regards,
Reece

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!
http://toolbar.msn.co.uk/


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