> On Aug. 15, 2017, 11:04 a.m., Andrew Schwartzmeyer wrote: > > 3rdparty/stout/include/stout/path.hpp > > Lines 68 (patched) > > <https://reviews.apache.org/r/60622/diff/1/?file=1768697#file1768697line68> > > > > I don't think I would use `bool addprefix` for this logic. A URI by > > definition is _required_ to have the scheme. In fact, as far as I can tell > > from the RFC, the scheme and the host are the only required parts of a URI: > > > > scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment] > > > > So using this with `addprefix = false` would _not_ return a URI, and > > then the function no longer makes sense. > > > > What use case drove the additoin of `bool addprefix`, can we solve it > > in another way?
Paths and URIs are fundamentally different things. So none of this backslash->slash replacement should be happening in the `Path` class. (Consider how Python has `os.path.join` and `urlparse.urljoin`.) I have some (incomplete) patches that add URI parsing to stout (See: https://reviews.apache.org/r/46588/diff/4#3 ). We basically need a URI class (without parsing for now) with some of the same helpers in the `path.hpp` file; especially something akin to `uri::join`. - Joseph ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/60622/#review182967 ----------------------------------------------------------- On July 3, 2017, 12:30 p.m., Jeff Coffler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/60622/ > ----------------------------------------------------------- > > (Updated July 3, 2017, 12:30 p.m.) > > > Review request for mesos, Andrew Schwartzmeyer, John Kordich, Joseph Wu, and > Li Li. > > > Bugs: MESOS-6705 > https://issues.apache.org/jira/browse/MESOS-6705 > > > Repository: mesos > > > Description > ------- > > Add new stout function: path::uri (convert filename to valid URI). > > > Diffs > ----- > > 3rdparty/stout/include/stout/path.hpp > 6ee3a44cd6a878fe383aa68df40b82857b93d0b4 > 3rdparty/stout/tests/path_tests.cpp > f8c14d5aefe0b49adb778da784143a328c96183d > > > Diff: https://reviews.apache.org/r/60622/diff/1/ > > > Testing > ------- > > See upstream > > > Thanks, > > Jeff Coffler > >