220 26352 <5ae721e4-434b-4ee0-a5fc-415441e6616d@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Sean Middleditch <sean.middleditch@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: File globbing in the standard library
Date: Mon, 20 Jun 2016 14:46:28 -0700 (PDT)
Lines: 213
Approved: news@gmane.org
Message-ID: <5ae721e4-434b-4ee0-a5fc-415441e6616d@isocpp.org>
References: <860ea5e8-d2f7-46d1-b1e0-e5493195fa28@isocpp.org>
 <20160608124715.4915278.35801.11796@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_879_2024987464.1466459188405"
X-Trace: ger.gmane.org 1466459199 24017 80.91.229.3 (20 Jun 2016 21:46:39 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 20 Jun 2016 21:46:39 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCDODCNR2QPRBNOIUG5QKGQEK5GNOSA@isocpp.org Mon Jun 20 23:46:33 2016
Return-path: <std-proposals+bncBCDODCNR2QPRBNOIUG5QKGQEK5GNOSA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCDODCNR2QPRBNOIUG5QKGQEK5GNOSA@isocpp.org>)
	id 1bF71c-0001kZ-19
	for gclcip-std-proposals@m.gmane.org; Mon, 20 Jun 2016 23:46:32 +0200
Original-Received: by mail-pf0-f197.google.com with SMTP id 143sf339411556pfx.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 20 Jun 2016 14:46:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=LyguR2ipYbLDOwblMYcPqAVo7QZwr4m5Q0CebpK5sVY=;
        b=c0iMzh6nCyh599cTV/gv7+/b27bBjndR7YaXaSUCuM2stl+x71xCBXbcWqx2byE8J6
         MPc7DHNGmzRtz+E9XmflI47oYjSVk7wUvl0AWk/jVR0KxCSIupC9FDdShLryUJhEraBb
         dqmVfqt9ZUSytyiLd1XavnmoiH3jvk0mgLWNoJPeGAJbQ3N/RsnwvV9OiGTqXpNXcjo/
         ayIJiUdfDqnC6MQ/q1TB8p1lsMwpxeBXx13K5aBTW61W+h27QpGLxK19+twkqGXRZDkg
         aJMtyTsNaJCa8MWbc4jjloMv+boUYqHzDYy7foqAiIviriYFw9nSSeni2W1hQchiYpif
         JbOg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=LyguR2ipYbLDOwblMYcPqAVo7QZwr4m5Q0CebpK5sVY=;
        b=gjRtT3i99S72oEOLp5w22s8rb/Tl7Z5NXrRjib2/myjjei6BQ61f+GqRwRIcjvDyP4
         mGJZr6lriEU3nLtKS3nuPVn0ahUNygZuz7QXXwSvo/i41hA1zw/XyfgR52JcwC1I2Txd
         IslcmnFXHYGtpRYcmZl81OtUm4M5kEmLGQvuhs8vdg0r7USQ2xlXuadKjK35dMYm8Jnk
         qYfiTiqTwEsDCLVNz45uiAwbksv+/3gR6jf4p9sLnLYX73huUEvSeaJvvxbqJQXID845
         QYp17SmJpTsa4SZWFpQ+ljePaimwyz7R49sZjQ8pkHK+qAC2+WSYb2uo2Xa//82i5mSj
         +d/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=LyguR2ipYbLDOwblMYcPqAVo7QZwr4m5Q0CebpK5sVY=;
        b=P0GNBKihlXoXCulSzvPTOIuXHsjE/rdRaQVLxVZj6j25MAiEPUinxwTjcH+Lvb9ga0
         5cm0GUTgq/ZIVh92Dpm6/CzcpfLbHgYAqKMvAEtU4/vDZ17hkNkJvxRpzA9wMf9Tvv1w
         iRs2UkzhnOhtolNpEIETq+Jgv23JST2s4i5y5mO8GI5RJLtb/TFwUyyAj7tTJmtxwmAY
         qq08R64ciYLrL7O4BKKJs4VhDwlaNt7aAE/pVJbsnonDxF2NCdBfXCYiFeAuv7RHLdgN
         CtndsHrM1ADDd6MuLAtWTHtsxR6vPeY5eWi24YjjsPFFYy1SN2496dNS7bG5h+aH9tEw
         1ItQ==
X-Gm-Message-State: ALyK8tJFRrr4FcxqlPlu1O4Anqkos6jQoD4/o6qe5dE094q/eADdm12jRgMsgDC3L0b54g==
X-Received: by 10.66.101.230 with SMTP id fj6mr23893461pab.15.1466459190819;
        Mon, 20 Jun 2016 14:46:30 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.92.16 with SMTP id q16ls11374itb.12.gmail; Mon, 20 Jun 2016
 14:46:29 -0700 (PDT)
X-Received: by 10.36.64.133 with SMTP id n127mr5947ita.4.1466459189573;
        Mon, 20 Jun 2016 14:46:29 -0700 (PDT)
In-Reply-To: <20160608124715.4915278.35801.11796@gmail.com>
X-Original-Sender: Sean.Middleditch@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:26352
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26352>

------=_Part_879_2024987464.1466459188405
Content-Type: multipart/alternative; 
	boundary="----=_Part_880_475283141.1466459188406"

------=_Part_880_475283141.1466459188406
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Could/should this be resolved the same way we handle regex, e.g.=20
glob_constants::POSIX, glob_constants::DOS, glob_constants::NATIVE, etc.?

On Wednesday, June 8, 2016 at 5:47:19 AM UTC-7, Tony V E wrote:
>
> Do you want cross-platform behaviour or platform-native behaviour?
>
> "*.*" is not the same under dos/windows vs unix/mac/linux.=20
>
> =E2=80=8ECross platform seems nice, but if a user tpes "*.*" into a custo=
m Open=20
> File dialog, I might want (as the user probably expects) per-platform=20
> behaviour.=20
>
>
>
> Sent from my BlackBerry portable Babbage Device
> *From: *Morwenn
> *Sent: *Wednesday, June 8, 2016 4:53 AM
> *To: *ISO C++ Standard - Future Proposals
> *Reply To: *std-pr...@isocpp.org <javascript:>
> *Subject: *[std-proposals] File globbing in the standard library
>
> The C++17 standard filesystem library would benefit from a generic file=
=20
> globbing utility, which is a really common operation when dealing with=20
> files.
> Here is a brief description of how I would envision it:
>
>    - Add a glob dialect to the regular expression libraries (with=20
>    standard jokers, including **).
>    - Add a glob function to path (or somewhere else) taking an std::regex=
..
>    - Add overloads to glob for std::string, std::string_view, const char*=
=20
>    that default to the newly introduced glob dialect.
>
> I guess that the string types mentioned above would use=20
> std::filesystem::path::value_type for their value type.
>
> I believe that using std::regex allows to have a truly generic globbing=
=20
> interface, while defaulting to a regular glob dialect provides the=20
> behaviour people expect by default for a glob function.
>
> Any thoughts about such a design?
>
> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to std-proposal...@isocpp.org <javascript:>.
> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
> To view this discussion on the web visit=20
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f=
7-46d1-b1e0-e5493195fa28%40isocpp.org=20
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2=
f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d%40isocpp.or=
g.

------=_Part_880_475283141.1466459188406
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Could/should this be resolved the same way we handle regex=
, e.g. glob_constants::POSIX, glob_constants::DOS, glob_constants::NATIVE, =
etc.?<br><br>On Wednesday, June 8, 2016 at 5:47:19 AM UTC-7, Tony V E wrote=
:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;"><div lang=3D"en-US" style=3D"=
background-color:rgb(255,255,255);line-height:initial">                    =
                                                                  <div styl=
e=3D"width:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,s=
ans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;background-col=
or:rgb(255,255,255)">Do you want cross-platform behaviour or platform-nativ=
e behaviour?</div><div style=3D"width:100%;font-size:initial;font-family:Ca=
libri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-a=
lign:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">&quot;*.*&quot; is not the same under dos/windows vs unix/mac/=
linux.=C2=A0</div><div style=3D"width:100%;font-size:initial;font-family:Ca=
libri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-a=
lign:initial;background-color:rgb(255,255,255)"><br></div><div style=3D"wid=
th:100%;font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">=E2=80=8ECross platform seems nice, but if a user tpes &quot;*=
..*&quot; into a custom Open File dialog, I might want (as the user probably=
 expects) per-platform behaviour.=C2=A0</div><div style=3D"width:100%;font-=
size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;=
color:rgb(31,73,125);text-align:initial;background-color:rgb(255,255,255)">=
<br></div><div style=3D"width:100%;font-size:initial;font-family:Calibri,&#=
39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31,73,125);text-align:ini=
tial;background-color:rgb(255,255,255)"><br></div>                         =
                                                                           =
                                 <div style=3D"width:100%;font-size:initial=
;font-family:Calibri,&#39;Slate Pro&#39;,sans-serif,sans-serif;color:rgb(31=
,73,125);text-align:initial;background-color:rgb(255,255,255)"><br style=3D=
"display:initial"></div>                                                   =
                                                                           =
                                                                     <div s=
tyle=3D"font-size:initial;font-family:Calibri,&#39;Slate Pro&#39;,sans-seri=
f,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(2=
55,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=A0<wbr>portable=C2=
=A0Babbage=C2=A0Device</div>                                               =
                                                                           =
                                                        <table width=3D"100=
%" style=3D"background-color:white;border-spacing:0px"> <tbody><tr><td cols=
pan=3D"2" style=3D"font-size:initial;text-align:initial;background-color:rg=
b(255,255,255)">                           <div style=3D"border-style:solid=
 none none;border-top-color:rgb(181,196,223);border-top-width:1pt;padding:3=
pt 0in 0in;font-family:Tahoma,&#39;BB Alpha Sans&#39;,&#39;Slate Pro&#39;;f=
ont-size:10pt">  <div><b>From: </b>Morwenn</div><div><b>Sent: </b>Wednesday=
, June 8, 2016 4:53 AM</div><div><b>To: </b>ISO C++ Standard - Future Propo=
sals</div><div><b>Reply To: </b><a href=3D"javascript:" target=3D"_blank" g=
df-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"this.=
href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;java=
script:&#39;;return true;">std-pr...@isocpp.org</a></div><div><b>Subject: <=
/b>[std-proposals] File globbing in the standard library</div></div></td></=
tr></tbody></table><div style=3D"border-style:solid none none;border-top-co=
lor:rgb(186,188,209);border-top-width:1pt;font-size:initial;text-align:init=
ial;background-color:rgb(255,255,255)"></div><br><div><div dir=3D"ltr">The =
C++17 standard filesystem library would benefit from a generic file globbin=
g utility, which is a really common operation when dealing with files.<br>H=
ere is a brief description of how I would envision it:<br><ul><li>Add a glo=
b dialect to the regular expression libraries (with standard jokers, includ=
ing <span style=3D"font-family:courier new,monospace">**</span>).</li><li>A=
dd a glob function to path (or somewhere else) taking an <span style=3D"fon=
t-family:courier new,monospace">std::regex</span>.</li><li>Add overloads to=
 glob for <span style=3D"font-family:courier new,monospace">std::string</sp=
an>, <span style=3D"font-family:courier new,monospace">std::string_view</sp=
an>, <span style=3D"font-family:courier new,monospace">const char*</span> t=
hat default to the newly introduced glob dialect.</li></ul>I guess that the=
 string types mentioned above would use <span style=3D"font-family:courier =
new,monospace">std::filesystem::path::</span><code><span style=3D"font-fami=
ly:arial,sans-serif"><span style=3D"font-family:courier new,monospace">valu=
e_<wbr>type</span> for their value type.</span><br><br><span style=3D"font-=
family:arial,sans-serif">I believe that using std::regex allows to have a t=
ruly generic globbing interface, while defaulting to a regular glob dialect=
 provides the behaviour people expect by default for a glob function.</span=
><br><br><span style=3D"font-family:arial,sans-serif">Any thoughts about su=
ch a design?</span><br></code></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"lK79S2k2AAAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/860ea5e8-d2f7-46d1-b1e0-e5493195fa28%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/860ea5e8-d2f7-46d1-<wbr>b1e0-=
e5493195fa28%40isocpp.org</a><wbr>.<br>
<br></div></div>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5ae721e4-434b-4ee0-a5fc-415441e6616d=
%40isocpp.org</a>.<br />

------=_Part_880_475283141.1466459188406--

------=_Part_879_2024987464.1466459188405--

.
