Subject: Re: [Boost-build] String processing
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-05-13 02:41:24
Anthony Foglia wrote:
> In our Jamfiles, we usually have a rule of the form:
> install all
> : OurExecutable
> : <variant>release:<location>Release
> Now I'm adding
> another variant, "production", for what goes on our production machines.
> The problem is that then running "bjam production all" gives and error that all
> depends on itself. I can fix this by adding a
> <variant>production:<location>Production. But it seems the
> smarter trick is to replace the <variant>release:<location>Release
> requirements with a <conditional> rule.
> Is there any documentation
> of how to do string processing with boost build? All I see are parameter
> expansion modifier to convert text to all lower or all upper case. I need
> something to convert it a string to title case.
I'm not aware of any relevant documentation either, so I don't if there is a better way to do it, but this should get you started:
local x = release ;
import string : chars join ;
local x-chars = [ chars $(x) ] ;
local y = [ join $(x-chars:U) $(x-chars[2-]) ] ;
echo $(y) ; # Prints "Release"
> -- Anthony Foglia
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk