I have seen your subst() function but I did not use it because I thought that
you wanted to switch to STL algorithms as much as possible.
The LSubString class could be extended but you'd have to decide what to do if
the substring isnt present. Do you want to append something to the original
string?
Why?
Shouldn't this be decided on a case to case basis?
Ok while we are at it, what is LSubstring intended for in the first place? It
can not be in heavy use
afaik, I believe there are four files, LaTeX.C, chset.C, vc-backend.C and
LSubstring.[Ch]where it is used.
I think it was intended to integrate LRegex right? Otherwise it wouldnt make
much sense indeed.
You can do everything with find() and replace()
I also believe the following constructor:
LSubstring::LSubstring(string & s, LRegex const & r)
should set n and pos to string::npos if the LRegex wasnt found.
I would therefore recommend to leave things in the patch as they are, because
the implementation shows clearly what
I intended which is:
find the substring $$FName
if it exists replace it with the actual filename
else append the actual filename
Roland
Jean-Marc Lasgouttes wrote:
> >>>>> "Lars" == Lars Gullik Bj�nnes <[EMAIL PROTECTED]> writes:
>
> Lars> LSubString foo(command, "$$FNAME"); for a command that does not
> Lars> contain a $$FNAME would not be a valid substring.
>
> Lars> So everything you do with it will fail/throw/abort etc.
>
> So I cannot use substrings unless I know the substring is present?
> This makes the class much less interesting, since I'll have to do a
> find() anyway... Would it be possible to change the class (not right
> now) to work even when the string has not been found (which subst()
> does quite well, by the way)?
>
> JMarc