Skip to content

Commit 3c74c2b

Browse files
authored
Add an introduction to the std.json documentation, fix some mistakes in std.curl and replace broken links in std.stdio (#8724)
* Fix some mistakes in curl.d * Add an introduction for std.json * Fix more documentation in curl.d * Fix broken links in std.stdio documentation
1 parent 91308f2 commit 3c74c2b

File tree

3 files changed

+35
-33
lines changed

3 files changed

+35
-33
lines changed

std/json.d

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Written in the D programming language.
22

33
/**
4-
JavaScript Object Notation
4+
Implements functionality to read and write JavaScript Object Notation values.
5+
6+
JavaScript Object Notation is a lightweight data interchange format commonly used in web services and configuration files.
7+
It's easy for humans to read and write, and it's easy for machines to parse and generate.
58
69
Copyright: Copyright Jeremie Pelletier 2008 - 2009.
710
License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).

std/net/curl.d

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SMTP) )
2323
)
2424
2525
Note:
26-
You may need to link to the $(B curl) library, e.g. by adding $(D "libs": ["curl"])
26+
You may need to link with the $(B curl) library, e.g. by adding $(D "libs": ["curl"])
2727
to your $(B dub.json) file if you are using $(LINK2 http://code.dlang.org, DUB).
2828
2929
Windows x86 note:
@@ -32,20 +32,19 @@ $(LINK2 https://downloads.dlang.org/other/index.html, download archive page).
3232
3333
This module is not available for iOS, tvOS or watchOS.
3434
35-
Compared to using libcurl directly this module allows simpler client code for
35+
Compared to using libcurl directly, this module allows simpler client code for
3636
common uses, requires no unsafe operations, and integrates better with the rest
37-
of the language. Futhermore it provides $(MREF_ALTTEXT range, std,range)
37+
of the language. Furthermore it provides $(MREF_ALTTEXT range, std,range)
3838
access to protocols supported by libcurl both synchronously and asynchronously.
3939
4040
A high level and a low level API are available. The high level API is built
4141
entirely on top of the low level one.
4242
4343
The high level API is for commonly used functionality such as HTTP/FTP get. The
44-
$(LREF byLineAsync) and $(LREF byChunkAsync) provides asynchronous
45-
$(MREF_ALTTEXT range, std,range) that performs the request in another
46-
thread while handling a line/chunk in the current thread.
44+
$(LREF byLineAsync) and $(LREF byChunkAsync) functions asynchronously
45+
perform the request given, outputting the fetched content into a $(MREF_ALTTEXT range, std,range).
4746
48-
The low level API allows for streaming and other advanced features.
47+
The low level API allows for streaming, setting request headers and cookies, and other advanced features.
4948
5049
$(BOOKTABLE Cheat Sheet,
5150
$(TR $(TH Function Name) $(TH Description)
@@ -79,18 +78,18 @@ byChunk("dlang.org", 10)) returns a range of ubyte[10] containing the
7978
dlang.org web page.)
8079
)
8180
$(TR $(TDNW $(LREF byLineAsync)) $(TD $(D
82-
byLineAsync("dlang.org")) returns a range of char[] containing the dlang.org web
83-
page asynchronously.)
81+
byLineAsync("dlang.org")) asynchronously returns a range of char[] containing the dlang.org web
82+
page.)
8483
)
8584
$(TR $(TDNW $(LREF byChunkAsync)) $(TD $(D
86-
byChunkAsync("dlang.org", 10)) returns a range of ubyte[10] containing the
87-
dlang.org web page asynchronously.)
85+
byChunkAsync("dlang.org", 10)) asynchronously returns a range of ubyte[10] containing the
86+
dlang.org web page.)
8887
)
8988
$(LEADINGROW Low level
9089
)
91-
$(TR $(TDNW $(LREF HTTP)) $(TD `HTTP` struct for advanced usage))
92-
$(TR $(TDNW $(LREF FTP)) $(TD `FTP` struct for advanced usage))
93-
$(TR $(TDNW $(LREF SMTP)) $(TD `SMTP` struct for advanced usage))
90+
$(TR $(TDNW $(LREF HTTP)) $(TD Struct for advanced HTTP usage))
91+
$(TR $(TDNW $(LREF FTP)) $(TD Struct for advanced FTP usage))
92+
$(TR $(TDNW $(LREF SMTP)) $(TD Struct for advanced SMTP usage))
9493
)
9594
9695
@@ -135,10 +134,10 @@ http.perform();
135134
First, an instance of the reference-counted HTTP struct is created. Then the
136135
custom delegates are set. These will be called whenever the HTTP instance
137136
receives a header and a data buffer, respectively. In this simple example, the
138-
headers are written to stdout and the data is ignored. If the request should be
137+
headers are written to stdout and the data is ignored. If the request is
139138
stopped before it has finished then return something less than data.length from
140139
the onReceive callback. See $(LREF onReceiveHeader)/$(LREF onReceive) for more
141-
information. Finally the HTTP request is effected by calling perform(), which is
140+
information. Finally, the HTTP request is performed by calling perform(), which is
142141
synchronous.
143142
144143
Source: $(PHOBOSSRC std/net/curl.d)
@@ -147,8 +146,8 @@ Copyright: Copyright Jonas Drewsen 2011-2012
147146
License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
148147
Authors: Jonas Drewsen. Some of the SMTP code contributed by Jimmy Cao.
149148
150-
Credits: The functionally is based on $(HTTP curl.haxx.se/libcurl, libcurl).
151-
LibCurl is licensed under an MIT/X derivative license.
149+
Credits: The functionality is based on $(HTTP curl.haxx.se/libcurl, libcurl).
150+
libcurl is licensed under an MIT/X derivative license.
152151
*/
153152
/*
154153
Copyright Jonas Drewsen 2011 - 2012.

std/stdio.d

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ Params:
534534
name = range or string representing the file _name
535535
stdioOpenmode = range or string represting the open mode
536536
(with the same semantics as in the C standard library
537-
$(HTTP cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen)
537+
$(HTTP cplusplus.com/reference/cstdio/fopen, fopen)
538538
function)
539539
540540
Throws: `ErrnoException` if the file could not be opened.
@@ -619,7 +619,7 @@ file.
619619
Detaches from the current file (throwing on failure), and then attempts to
620620
_open file `name` with mode `stdioOpenmode`. The mode has the
621621
same semantics as in the C standard library $(HTTP
622-
cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen) function.
622+
cplusplus.com/reference/cstdio/fopen, fopen) function.
623623
624624
Throws: `ErrnoException` in case of error.
625625
*/
@@ -933,7 +933,7 @@ Throws: `ErrnoException` in case of error.
933933

934934
/**
935935
Returns `true` if the file is at end (see $(HTTP
936-
cplusplus.com/reference/clibrary/cstdio/feof.html, feof)).
936+
cplusplus.com/reference/cstdio/feof, feof)).
937937
938938
Throws: `Exception` if the file is not opened.
939939
*/
@@ -961,7 +961,7 @@ Throws: `Exception` if the file is not opened.
961961

962962
/**
963963
If the file is closed or not yet opened, returns `true`. Otherwise, returns
964-
$(HTTP cplusplus.com/reference/clibrary/cstdio/ferror.html, ferror) for
964+
$(HTTP cplusplus.com/reference/cstdio/ferror, ferror) for
965965
the file handle.
966966
*/
967967
@property bool error() const @trusted pure nothrow
@@ -1018,7 +1018,7 @@ Throws: `ErrnoException` on failure if closing the file.
10181018
/**
10191019
If the file was closed or not yet opened, succeeds vacuously. Otherwise
10201020
closes the file (by calling $(HTTP
1021-
cplusplus.com/reference/clibrary/cstdio/fclose.html, fclose)),
1021+
cplusplus.com/reference/cstdio/fclose, fclose)),
10221022
throwing on error. Even if an exception is thrown, afterwards the $(D
10231023
File) object is empty. This is different from `detach` in that it
10241024
always closes the file; consequently, all other `File` objects
@@ -1046,7 +1046,7 @@ Throws: `ErrnoException` on error.
10461046

10471047
/**
10481048
If the file is closed or not yet opened, succeeds vacuously. Otherwise, returns
1049-
$(HTTP cplusplus.com/reference/clibrary/cstdio/_clearerr.html,
1049+
$(HTTP cplusplus.com/reference/cstdio/clearerr,
10501050
_clearerr) for the file handle.
10511051
*/
10521052
void clearerr() @safe pure nothrow
@@ -1058,7 +1058,7 @@ _clearerr) for the file handle.
10581058
/**
10591059
Flushes the C `FILE` buffers.
10601060
1061-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/_fflush.html, _fflush)
1061+
Calls $(HTTP cplusplus.com/reference/cstdio/fflush, _fflush)
10621062
for the file handle.
10631063
10641064
Throws: `Exception` if the file is not opened or if the call to `fflush` fails.
@@ -1125,7 +1125,7 @@ Throws: `Exception` if the file is not opened or if the OS call fails.
11251125
}
11261126

11271127
/**
1128-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/fread.html, fread) for the
1128+
Calls $(HTTP cplusplus.com/reference/cstdio/fread, fread) for the
11291129
file handle. The number of items to read and the size of
11301130
each item is inferred from the size and type of the input array, respectively.
11311131
@@ -1220,7 +1220,7 @@ Throws: `ErrnoException` if the file is not opened or the call to `fread` fails.
12201220
}
12211221

12221222
/**
1223-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/fwrite.html, fwrite) for the file
1223+
Calls $(HTTP cplusplus.com/reference/cstdio/fwrite, fwrite) for the file
12241224
handle. The number of items to write and the size of each
12251225
item is inferred from the size and type of the input array, respectively. An
12261226
error is thrown if the buffer could not be written in its entirety.
@@ -1290,7 +1290,7 @@ Throws: `ErrnoException` if the file is not opened or if the call to `fwrite` fa
12901290
}
12911291

12921292
/**
1293-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/fseek.html, fseek)
1293+
Calls $(HTTP cplusplus.com/reference/cstdio/fseek, fseek)
12941294
for the file handle to move its position indicator.
12951295
12961296
Params:
@@ -1420,7 +1420,7 @@ Throws: `Exception` if the file is not opened.
14201420
}
14211421

14221422
/**
1423-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/_rewind.html, _rewind)
1423+
Calls $(HTTP cplusplus.com/reference/cstdio/rewind, _rewind)
14241424
for the file handle.
14251425
14261426
Throws: `Exception` if the file is not opened.
@@ -1434,7 +1434,7 @@ Throws: `Exception` if the file is not opened.
14341434
}
14351435

14361436
/**
1437-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/_setvbuf.html, _setvbuf) for
1437+
Calls $(HTTP cplusplus.com/reference/cstdio/setvbuf, _setvbuf) for
14381438
the file handle.
14391439
14401440
Throws: `Exception` if the file is not opened.
@@ -1450,7 +1450,7 @@ Throws: `Exception` if the file is not opened.
14501450
}
14511451

14521452
/**
1453-
Calls $(HTTP cplusplus.com/reference/clibrary/cstdio/_setvbuf.html,
1453+
Calls $(HTTP cplusplus.com/reference/cstdio/setvbuf,
14541454
_setvbuf) for the file handle.
14551455
14561456
Throws: `Exception` if the file is not opened.
@@ -2253,7 +2253,7 @@ $(CONSOLE
22532253

22542254
/**
22552255
Returns a temporary file by calling
2256-
$(HTTP cplusplus.com/reference/clibrary/cstdio/_tmpfile.html, _tmpfile).
2256+
$(HTTP cplusplus.com/reference/cstdio/tmpfile, _tmpfile).
22572257
Note that the created file has no $(LREF name).*/
22582258
static File tmpfile() @safe
22592259
{

0 commit comments

Comments
 (0)