[FR] Range <-> String, Point::fromString


#1

I'm rather surprised this isn't already in, but would like to request Range::toString() and Range::fromString() methods, likewise for Point::fromString.


#2

For Point, yes, good request.

For Range, not 100% sure what the format of the string would be: should it be comma-separated, or use a space, or something else?


#3

A space would be equally easy to find as a comma, I would think. I'm not really seeing any better option.

If you want to look at it from a consistency POV:

  • Point::toString() returns something like "0, 0"
  • Rectangle::toString() returns something like "0 0 0 0"

Looks like either way works.


#4

Is this something you're still looking at, Jules?


#5

May do it for Point, probably not for Range..

(Easy enough to add this kind of thing with free functions though)