Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2004-09-23 02:18:58


Reece Dunn wrote:
> John Torjo wrote:
>
>> Rob Stewart wrote:
>>
>>> Agreed, but pipes ("|") are easier to grok:
>>>
>>> "<elem> | </elem><elem> | </elem>"
>>>
>>
>> That's fine too.
>
>
> This again runs into the problem of what if you want '|' in your format
> string? One possibility is to use non-printable characters, e.g. \xFF,
> but I don't think this would have widespread support.
>
> Implementing escaping for the above will complicate the evaluation of
> the format string as you cannot use str.find( "|" ). One possibility is
> to check if '\' exists before '|' after a find; if yes, repeat. Thus '\'
> becomes context-sensitive. This approach leads to "< |\\| >" for "<
> a\\b\\c >" formatting being ill-defined.
>

I am optimistic and know you'll find a solution. The same goes for when
you use any string in C++ code. If you want '"' character, you escape
it. So, just make it easy to escape a few chars ;)

Best,
John

-- 
John Torjo
-- john_at_[hidden]
Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/
-- v1.4 - save_dlg - true binding of your data to UI controls!
    + easily add validation rules (win32gui/examples/smart_dlg)

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