Notes |
|
(0021234)
|
Rolf Eike Beer
|
2010-07-04 13:47
|
|
These patches (based on efee95cd710808ca7ac261359b9b8e6dacb09211) implement both things and add testcases to make sure that works as expected. |
|
|
(0021235)
|
Rolf Eike Beer
|
2010-07-04 13:48
|
|
Please replace the From line with
From: Rolf Eike Beer <eike@sf-mail.de>
before applying. |
|
|
(0022116)
|
David Cole
|
2010-09-07 17:24
|
|
Changing target version... Since there is a way to accomplish this with existing CMake and this is merely a "convenience" feature request, and it is a new feature.... I'm delaying the implementation for this issue to a future release (not for 2.8.3). CMake devs do not have enough time left before 2.8.3 to work on this issue.
I don't like the word "CHOP" and I'm not sure that we should extend SUBSTRING to use "-1" as meaning "the rest of the string". Or at least use the word "truncate" rather than chop. Truncate has a specific meaning of chopping off the end, whereas chop could mean chop off either end.
Even better, though, I think it would be more clear to introduce new methods in the string command for string(LEFT and string(RIGHT.
|
|
|
(0022117)
|
Rolf Eike Beer
|
2010-09-07 17:31
|
|
I just took the "chop" from Qt's QString, I don't have any objections against truncate.
RIGHT and LEFT would still not solve the "issue" to just remove the first n characters without checking the length first. |
|
|
(0022118)
|
David Cole
|
2010-09-07 17:36
|
|
Certainly for now, you could write a function or macro in the CMake language that performs these operations in a more elegant manner... but uses MATH and SUBSTRING under the hood. |
|
|
(0023825)
|
Ben Boeckel
|
2010-12-08 16:52
|
|
I applied the substring patch. Is there some reason to apply the CHOP (or an equivalent) without a mirror version to take from the beginning of the string? A RIGHT and LEFT would suffice for that I'd think. |
|
|
(0023858)
|
Rolf Eike Beer
|
2010-12-09 16:10
|
|
Well, that substring one is basically the opposite of the CHOP. We could make CHOP_RIGHT and CHOP_LEFT (or whatever) from them. Or any better name one could imagine. I can't ;) |
|
|
(0023859)
|
Ben Boeckel
|
2010-12-09 16:17
|
|
The patch that was attached added -1 as "rest of string" so that would conflict with a meaning of going backwards in the string. Alternatively, a value of 0 could mean "rest of string" as a length of 0 is no different then setting a variable to the empty string, but this breaks backwards compatibility and is probably not a valid solution for CMake. I'll look at implementing RIGHT and LEFT. Maybe FIRST and LAST as names? |
|
|
(0023860)
|
David Cole
|
2010-12-09 16:26
|
|
There's no need for LEFT or FIRST:
string(LEFT 5 ...)
because it's equivalent to:
string(SUBSTRING 0 5 ...)
But it probably doesn't make sense to provide a RIGHT if there is no LEFT...
Coming up with the proper names here is critical for this issue. It should "do what it's named" so that 99.9% of people who encounter just know what it does without looking up the documentation. |
|
|
(0024473)
|
Ben Boeckel
|
2011-01-06 14:39
|
|
|
|
(0025229)
|
Rolf Eike Beer
|
2011-02-03 05:40
|
|
There are some error messages in the C++ file and the documentation that need to reflect the change. I'll cook up a patch tonight. |
|
|
(0026599)
|
David Cole
|
2011-05-25 17:19
|
|
Hi Rolf,
Have any patches been cooked up?
What error messages need to change? |
|
|
(0026615)
|
Rolf Eike Beer
|
2011-05-26 07:06
|
|
|
|
(0026616)
|
David Cole
|
2011-05-26 07:29
|
|
Ah, thanks. I didn't notice that a patch had been attached after your previous note... |
|
|
(0026671)
|
David Cole
|
2011-06-05 14:30
|
|
|
|
(0027759)
|
David Cole
|
2011-11-11 10:45
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|