Georg Baum wrote: > Am Sonntag, 3. September 2006 10:50 schrieb Michael Gerz: >> Hi, >> >> as far as I understand, all occurrences of std::string are supposed to >> be replaced by docstring sooner or later. > > No. All occurrences of std::string that store document content are supposed > to be replaced. There is no need to change stuff that will always be in > ASCII, e.g. lfun names or LaTeX command names in mathed. >
To distinguish the ASCII strings from the strings we have to replace we could introduce a typedef: typedef asciistring std::string so it becomes clear that a asciistring should never be replaced by a docstring, and all std::strings are todo items, where we have to decide between asciistring and docstring. >> A simple grep shows about 8000 (!) occurrences of std::string. I wonder >> whether we should apply a global search&replace and fix the shard >> afterwards... > > I don't think that we should do that, because it will do unnecessary > conversions that we have to undo afterwards. I think that doing the > conversion in chunks is better. I already discovered encoding problems > that way (e.g. we insert the contents of external files without knowing > the encoding) and added a FIXME. This would not be discovered with > search/replace conversion. > I am currently working on streams for docstring. Once that infrastructure > (and a few more functions in lstrings.h) is in place the actual conversion > will be quite a bit of work, but not difficult. > > > Georg > > -- Peter