On Tuesday 05 November 2002 11:36 am, Andre Poenitz wrote: > On Tue, Nov 05, 2002 at 11:14:37AM +0000, Angus Leeming wrote: > > void InsetCommandParams::setFromString(string const & b) > > { > > string::size_type idx = b.find("|++|"); > > if (idx == string::npos) { > > cmdname = b; > > contents = ""; > > options = ""; > > return; > > } > > Actually I don't really like this idea of magic delimiters.
Me neither. I think we should use the lyx file format to pass stuff through the dispatch methods and use the various read and write methods to parse it and generate it respectively. That way we are guaranteed that things will work always. Moreover, it makes it really easy to deal with the outside world through the LyX server. No need to document any "magic". > At least if we can't pass three separate strings (which should be the > prefered solution) we could use some "safe char" e.g. '\001' and read > from the string with getline. This is a little better than the current solution (mine ;-) but is still less than elegant. Angus