PDA

View Full Version : Seperator obeysquotes member


Eglin
11-14-2003, 01:34 PM
I would like to suggest that the Seperator object have a boolean flag member added to indicate whether or not the object was created with the obeysquotes member (simply set the flag with the constructor parameter).

As it is, from the client perspective, if you are given a seperator, you have no way of determining if it respected quoting when it parsed its arguments.

Eglin
11-17-2003, 08:27 PM
It might be cool to also store a copy of the original string in complete form with each object. I have found that there are cases where I'd like to be able to recall the entire text, and having to reassemble it seems ineffecient.

DeletedUser
11-30-2003, 05:56 PM
seperator->argplus[0] should be what you're looking for. It stores a pointer to the original string (so be careful to check if that's been de-allocated).

Eglin
11-30-2003, 09:05 PM
seperator->argplus[0] should be what you're looking for. It stores a pointer to the original string (so be careful to check if that's been de-allocated).
Thanks for pointing that out. In the interem between my post and yours, a msg member has been added to the code that does what I need w/o the subtle danger of memory corruption that you warn of. Since seperators are useful, I could easily see getting into trouble with "Seperator foo("bar");", so I fully support changing them to operate on a local copy of the string. Reviewing the code, though, I see that the argplus array needs to be set to point to the msg member to reflect the change. Also, for some reason the code to free the mem is commented out. Worth looking into.