Commit graph

270 commits

Author SHA1 Message Date
Dennis
5cd77a6e32
User hyperlinks to refer to bugzilla issues (#8766) 2023-06-16 14:45:44 +03:00
Dmytro Katyukha
f263028f11 std.path.absolutePath: make compatible with scope and preview='in'
When using `absolutePath` with 'priview=in' enabled,
it requires to duplicate value to be able to call this function.
Within this commit the signature of `absolutePath` function
is changed from `string absolutePath(string path, lazy string base = getcwd())`
to `string absolutePath(return scope const string path, lazy string base = getcwd())`
thus, after this commit it is possible to use this func in scope context.

Example case:

```d
/+ dub.sdl:
    name "dub-example"
    dflags "-preview=in" "-preview=dip1000"
+/

import std.stdio;
import std.path;

@safe:

    string fun(in string path) {
        return path.absolutePath;
    }

    void main() {
        string p = fun("~/tests/1");
        writefln("P: %s", p);
    }

```
2023-06-03 01:21:02 +02:00
Dmytro Katyukha
9fadf8ad49 std.path.expandTilde: make compatible with scope and preview='in'
When using `expandTilde` with 'priview=in' enabled,
it requires to duplicate value to be able to call this function.
Within this commit the signature of expandTilde function is
changed from `string expandTilde(string inputPath) @safe nothrow`
to `string expandTilde(return scope const string inputPath) @safe nothrow`
thus, after this commit it is possible to use this func in scope
context.

Example case:

```d
/+ dub.sdl:
    name "dub-example"
    dflags "-preview=in" "-preview=dip1000"
+/

import std.stdio;
import std.path;

@safe:

    string fun(in string path) {
        return path.expandTilde;
    }

    void main() {
        string p = fun("~/tests/1");
        writefln("P: %s", p);
    }
```
2023-05-23 01:51:57 +02:00
Dennis Korpel
17b1a11afd Remove redundant assumeUnique in std.path 2023-03-25 04:49:48 +01:00
Razvan Nitu
07bbd10eb9
Merge pull request #8550 from wolframw/nothrow_contracts2
improve precondition of std.path.globMatch
2022-09-26 05:47:20 +03:00
Iain Buclaw
d51e3f99a3 fix Issue 23340 - std.path: expandTilde erroneously raises onOutOfMemory on failed getpwam_r() 2022-09-19 00:00:29 +02:00
wolframw
4bd1ac2fbf
improve precondition of std.path.globMatch 2022-09-01 22:12:15 +02:00
wolframw
92f8193301 don't throw from nothrow contracts 2022-08-29 01:04:12 +02:00
Dennis Korpel
ef3dc5f5bb Fix std.path unittest returning dangling pointer 2022-04-16 15:59:43 +02:00
WebFreak001
dac59a4bde add isSomeFiniteCharInputRange as simplification
combines the very common constraint
`isInputRange!R && !isInfinite!R && isSomeChar!(ElementEncodingType!R)`
and adds a bunch of documentation with examples for users to understand
it better. This should lower the neccessary needed technical insight to
read basic docs, especially std.path and std.file docs.
2022-01-15 18:38:52 +01:00
vladchicos
68dab0e2e5 Fix Issue 19727 - std.algorithm.endsWith fails to compile while startsWith succeeds. 2021-08-12 05:09:14 +03:00
dkorpel
9ec24190b1 add explicit scope/return for pure functions 2021-07-11 13:34:25 +00:00
nordlow
61d60d2121 Annotate std/file.d to please dlang/dmd#12520 2021-05-20 13:14:21 +02:00
nordlow
dc54832b5c Annotate std/path.d to please dlang/dmd#12520, absolutePath excluded 2021-05-19 04:06:24 +02:00
Iain Buclaw
7ff6bb705d Revert "Annotate std/path.d to please dlang/dmd#12520"
This reverts commit 384b4be243.
2021-05-18 06:48:54 +02:00
nordlow
384b4be243 Annotate std/path.d to please dlang/dmd#12520 2021-05-17 19:00:35 +08:00
Nathan Sashihara
fe1deb2f84 Fix a few places where opDollar could be an alias of length 2020-11-11 02:09:56 +01:00
Nathan Sashihara
453faadf5b Replace is(Unqual!T == Unqual!U) with is(immutable T == immutable U) for speed & memory usage 2020-08-03 15:07:32 +02:00
Martin Kinkelin
86a24dcafe std.path: Fix tilde expansion for HOME=/ 2020-06-11 20:40:39 +02:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Jacob Carlborg
b16fca2206 Set case insensitive to default on iOS derived platforms for std.path 2020-03-14 15:06:35 +01:00
Jacob Carlborg
280f3fce87 Disable most of std.process on iOS derived platforms
A process does not have permission to create new processes on
iOS derived platforms.
2020-03-03 12:51:07 +01:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00
Lance Bachmeier
84107c620a Provide a complete description of dirName output
The current documentation is not complete. The user may be surprised when this function returns ".", as it may lead to problems if you are using the output of a call to dirName elsewhere.
2019-12-26 09:33:33 +02:00
David Gileadi
775bcdee51 Turn on -preview=markdown 2019-07-04 10:28:30 -07:00
Sebastian Wilzbach
8bc39461aa Use selective top-level module imports in std.{path,range,regex} 2019-05-23 10:25:16 +02:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Basile Burg
db819575f1 Fix issue 11959 - Set private symbols declared in version(unittest) blocks 2018-08-26 10:22:11 +02:00
Sebastian Wilzbach
84b98fc3f0 Remove invalid Markdown backticks in std.{container,path,random}.d 2018-06-19 22:04:01 +02:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
The Dlang Bot
7ab0e8c4dc
Merge pull request #6274 from JackStouffer/issue18178
Fix Issue 18178 - std.path should be usable in @safe
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-05-10 16:56:21 +02:00
Jack Stouffer
f6e4416a72 Fix Issue 18178 - std.path should be usable in @safe 2018-05-08 08:32:09 -04:00
Jack Stouffer
c1399d34b0 Added examples to std.path 2018-04-26 11:55:07 -04:00
The Dlang Bot
e13e3889ac
Merge pull request #6435 from JackStouffer/input-range-link
Make references to input ranges a link to isInputRange
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-04-15 01:42:45 +02:00
Steven Schveighoffer
d4a35f09da More removal of version(unittest) 2018-04-13 12:20:02 -04:00
Jack Stouffer
e14f89e170 Make references to input ranges a link to isInputRange 2018-04-08 16:19:57 -04:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Walter Bright
49216a2707 make buildNormalizedPath() @safe 2018-03-27 18:14:12 -07:00
Jack Stouffer
663b5b9278 Revert addition of StdUnittest 2018-02-20 13:32:32 -05:00
Jack Stouffer
18cbb29b04 Replaced version(unittest) blocks with version(StdUnittest) 2018-02-01 19:56:59 -05:00
Jonathan M Davis
8d158d3a1d Fix safety of withDefaultExtension for implicitly convertible types. 2018-01-27 21:02:49 -07:00
Jonathan M Davis
32e4e8ab13 Remove some unnecessary template constraints.
The public-facing functions already should protect these private
functions against getting bad input, and we might as well avoid making
the compiler do extra work.
2018-01-27 20:30:27 -07:00
Jonathan M Davis
39fa1a5532 Fix safety of withExtension for implicitly convertible types. 2018-01-27 20:30:27 -07:00
Jonathan M Davis
47b67275d9 Add missing template constraint on stripDrive. 2018-01-27 20:23:19 -07:00
Jonathan M Davis
879f6851ac Fix safety of stripExtension for implicitly convertible types. 2018-01-27 20:23:19 -07:00
Sebastian Wilzbach
70d3b892ff
Merge pull request #5410 from jmdavis/path
Fix safety issues with driveName, stripDrive, and rootName
2018-01-28 02:12:46 +01:00
Jonathan M Davis
d4a7e693d7 Fix safety of stripDrive for implicitly convertible types. 2018-01-27 17:15:54 -07:00
Jonathan M Davis
13240d7825 Fix safety of rootName for implicitly convertible types. 2018-01-27 17:15:54 -07:00
Jonathan M Davis
0af330d2de Fix safety of driveName for implicitly convertible types. 2018-01-27 17:15:54 -07:00
Lance Bachmeier
04dbe396b9
Update path.d 2018-01-26 16:33:55 -06:00