Skip to content

Commit acc6ca3

Browse files
author
delphidabbler
committed
Merge tag 'v2.0.0' into develop
First v2 release
2 parents 02cb427 + 01f50a2 commit acc6ca3

32 files changed

+793
-197
lines changed

csdb/CHANGELOG.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,45 @@
11
# Changelog
22

3-
This is the change log for the _DelphiDabbler Code Snippets Database_ collection starting with version 2.
3+
This is the change log for the _DelphiDabbler Code Snippets Database_ collection.
44

5-
All notable changes to this project will be documented in this file.
5+
From v2.0.0 all notable changes to this project will be documented in this file.
6+
7+
> No change log was kept for version 1 of the collection.
68
79
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
810

9-
> No change log was kept for version 1 of the collection.
11+
## v2.0.0 of 2020/05/02
12+
13+
Initial release of v2 of the collection.
1014

11-
## v2.0.0 of 2020/xx/xx
15+
### Changes since last v1 release
1216

13-
* Initial release of v2 of the collection.
17+
* Removed any code that restricted use of the collection to _[DelphiDabbler CodeSnip](https://github.com/delphidabbler/codesnip)_. The collection can now be used by 3rd party applications.
18+
* Removed backwards compatibility with _CodeSnip_ v4.15.1 and earlier.
19+
* Removed conditionally included code and _CodeSnip_ version dependent code from category .ini files.
20+
* Merged multiple versions of category .ini files down into a single file. (These multiple file were used to hide some categories from earlier versions of _CodeSnip_).
21+
* Removed duplicated, _CodeSnip_ version dependent, source code files: used a copy of the most recent version and removed version specifiers from the file names.
22+
* Rationalised and corrected errors in category .ini files:
23+
* Condensed two string management categories into one.
24+
* Removed `Desc` keys where they duplicated `DescEx` keys.
25+
* Removed some duplicate `Credits` and `Comments` keys.
26+
* Removed some empty keys.
27+
* Fixed or removed some broken web links.
28+
* Rephrased some descriptive text.
29+
* Changed layout of category .ini files and `categories.ini`:
30+
* Re-ordered sections of `categories.ini` in alphabetic order.
31+
* Removed all explanatory comments: there were inconsistencies.
32+
* Added header comments, including copyright and licensing information, to all .ini files.
33+
* File format changes:
34+
* Removed the `StandardFormat` key from the specification of category .ini files.
35+
* Added requirements for `LICENSE`, `LICENSE_INFO` and `VERSION` files and added suitable files to the collection.
36+
* Changed the required name for the contributors and testers files to `CONTRIBUTORS` and `TESTERS` respectively. Renamed the existing `contrib.txt` and `testers.txt` files accordingly.
37+
* Made support for REML v4 an official requirement.
38+
* Dropped support for conditional inclusion of code in .ini files.
39+
* Added documentation:
40+
* Of the collection file format.
41+
* A read-me file.
42+
* This change log.
43+
* Ensured that all files in the collection use the UTF-8 text file preamble (aka byte order mark).
44+
* Added a shell script to create releases.
45+
* Officially adopted the MIT license for source code files.

csdb/MakeRelease.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#!/bin/bash
22

33
# --------------------------------------------------------------------------
4+
# DelphiDabbler Code Snippets Database v2
45
#
56
# Build tool for Windows to package up files ready for release.
67
#
8+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
9+
# https://gravatar.com/delphidabbler
10+
#
11+
#
712
# Two packages are made, each in a zip file: one containing the collection and
813
# the other containing documentation. Both zip files are written to the
914
# _release sub-folder in the collection's home directory.
1015
#
11-
# Any pre-existing _release sub-folder is deleted before the zip files are
16+
# Any pre-existing _release sub-folder is cleared before the zip files are
1217
# created.
1318
#
1419
# Requirements:
@@ -23,17 +28,18 @@
2328

2429
VERSION=$1
2530
RELEASE_DIR="./_release"
26-
RELEASE_FILE_PREFIX="csdb-v"
27-
COLLECTION_ZIP_FILE="${RELEASE_DIR}/${RELEASE_FILE_PREFIX}${VERSION}.zip"
28-
DOCS_ZIP_FILE="${RELEASE_DIR}/${RELEASE_FILE_PREFIX}${VERSION}-docs.zip"
31+
RELEASE_FILE_STUB="${RELEASE_DIR}/csdb-v${VERSION}"
32+
33+
COLLECTION_ZIP_FILE="${RELEASE_FILE_STUB}-data.zip"
34+
DOCS_ZIP_FILE="${RELEASE_FILE_STUB}-docs.zip"
2935

3036
echo Creating CSDB release $1
3137
echo
3238

3339
rm -rf $RELEASE_DIR || true
3440
mkdir $RELEASE_DIR
3541

36-
echo Zipping collection
42+
echo Zipping data
3743
zip -j -q $COLLECTION_ZIP_FILE ./collection/*
3844

3945
echo Zipping documentation

csdb/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,35 @@ All of the snippets have been tested: some received basic testing while others h
88

99
## History
1010

11-
Version 1 was designed exclusively for use with _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ and was downloaded by the program directly from a web service on DelphiDabbler.com.
11+
Version 1 was designed exclusively for use with _DelphiDabbler [CodeSnip](https://github.com/delphidabbler/codesnip)_ (v4.15.1 and earlier) and was downloaded by the program directly from a web service on DelphiDabbler.com.
1212

13-
Version 2 is designed to be able to be used by other applications in addition to _CodeSnip_. This version is **not** backwards compatible with version 1.
13+
Version 2 is designed to be able to be used by other applications in addition to _CodeSnip_ (v4.16.0 or later). This version is **not** backwards compatible with version 1.
1414

1515
## Using the Collection
1616

17-
When used with _CodeSnip_, v4.16.0 or later is required.
17+
Anyone is welcome to write applications or web pages that access the snippets in the collection, subject to the terms of the license (see below). You should read the collection's documentation which explains the file format in detail.
1818

19-
Anyone is welcome to write applications or web pages that access the snippets in the collection. You should read the collection's documentation which explains the file format in detail.
20-
21-
> **WARNING:** Implementors must not read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
19+
> **WARNING:** Implementors **must not** read the collection data directly from this GitHub repository - that could generate more than the permitted amount of traffic. Instead you must download a release from the _Releases_ tab and either distribute the collection with the application or host it on a web server.
2220
2321
## Documentation
2422

2523
The collection data format is fully documented in the file `collection-format.html` in the `docs` directory.
2624

25+
## Releases
26+
27+
Releases can be found on the `releases` tab on the GitHub project page.
28+
29+
Each release comprises two zip files, as follows (replace `X.Y.X` in the file names with the release version number):
30+
31+
* `csdb-vX.Y.Z-data.zip` - Contains all the data in the collection. Required by applications that access the collection.
32+
* `csdb-vX.Y.Z-docs.zip` - Contains the documentation developers need to understand the structure of the data.
33+
2734
## Change Log
2835

2936
The project's change log can be found in `CHANGELOG.md` in the collection's base directory.
3037

3138
## License
3239

33-
All snippets in this collection are licensed under the MIT license **unless** the snippet contains contrary licensing information in its source code file, in which case that license applies to that snippet only.
40+
All snippets in this collection (stored in `.dat` files in the `collections` directory) are licensed under the MIT license and are copyright © 2005-2020, [Peter Johnson](https://gravatar.com/delphidabbler) and Contributors. The full license and a list of contributors can be found in the `LICENSE` and `CONTRIBUTORS` files in the `collection` sub-directory.
3441

35-
Full details can be found in the `LICENSE` file in the `collection` sub-directory.
42+
All other files in this project are licensed under the MIT license and are copyright © 2020, [Peter Johnson](https://gravatar.com/delphidabbler).

csdb/collection/LICENSE

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
All snippets in this collection are licensed under the MIT license (see below) UNLESS the snippet contains contrary licensing information in its source code file, in which case that license applies to that snippet only.
2-
3-
MIT License
4-
-----------
1+
All snippets in this collection are licensed under the MIT license.
52

63
>> Begin license text
74

csdb/collection/arrays.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[ArrayToStringList]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Arrays category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[ArrayToStringList]
29
DescEx="<p>Copies the elements of string array <var>Strings</var> to string list <var>SL</var>, replacing any existing contents of <var>SL</var>.</p>"
310
SeeAlso=StringListToArray
411
Units=Classes
@@ -132,8 +139,6 @@ DelphiXE4=Y
132139
Delphi10S=Y
133140
FPC=Y
134141

135-
# from arrays.3.ini
136-
137142
[AppendByteArray]
138143
DescEx="Appends array of bytes <var>B2</var> to the end of byte array <var>B1</var>."
139144
Depends=TBytes
@@ -342,8 +347,6 @@ DelphiXE4=Y
342347
Delphi10S=Y
343348
FPC=Y
344349

345-
# from arrays.4.ini
346-
347350
[TArrayUtils]
348351
Kind=class
349352
Desc="A method-only advanced record that provides utility methods for working with generic dynamic arrays."

csdb/collection/categories.ini

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
[arrays]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Master categories file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[arrays]
29
Desc=Arrays
310
Ini=arrays.ini
411

12+
[consts]
13+
Desc=Constants
14+
Ini=consts.ini
15+
516
[date]
617
Desc=Date and Time
718
Ini=date.ini
@@ -14,10 +25,6 @@ Ini=drive.ini
1425
Desc=Encoding
1526
Ini=encoding.ini
1627

17-
[io]
18-
Desc=File and Stream I/O
19-
Ini=io.ini
20-
2128
[file]
2229
Desc=File Management
2330
Ini=file.ini
@@ -30,9 +37,9 @@ Ini=graphics.ini
3037
Desc=Hex Utilities
3138
Ini=hex.ini
3239

33-
[web]
34-
Desc=Internet
35-
Ini=web.ini
40+
[io]
41+
Desc=File and Stream I/O
42+
Ini=io.ini
3643

3744
[maths]
3845
Desc=Mathematics
@@ -46,48 +53,42 @@ Ini=multimedia.ini
4653
Desc=Registry
4754
Ini=registry.ini
4855

49-
[string-1]
50-
Desc=String Management (A..M)
51-
Ini=string-am.ini
56+
[shell]
57+
Desc=Windows Shell
58+
Ini=shell.ini
59+
60+
[string]
61+
Desc=String Management
62+
Ini=string.ini
5263

53-
[string-2]
54-
Desc=String Management (N..Z)
55-
Ini=string-nz.ini
64+
[structs]
65+
Desc="Structures"
66+
Ini=structs.ini
5667

5768
[system]
5869
Desc=System
5970
Ini=sys.ini
6071

72+
[types]
73+
Desc=Types
74+
Ini=types.ini
75+
6176
[util]
6277
Desc=Utilities
6378
Ini=utils.ini
6479

80+
[wb]
81+
Desc="TWebBrowser"
82+
Ini=wb.ini
83+
84+
[web]
85+
Desc=Internet
86+
Ini=web.ini
87+
6588
[win]
6689
Desc=Windows
6790
Ini=windows.ini
6891

69-
[shell]
70-
Desc=Windows Shell
71-
Ini=shell.ini
72-
7392
[winsys]
7493
Desc=Windows System
7594
Ini=winsys.ini
76-
77-
# from categories.3.ini
78-
79-
[consts]
80-
Desc=Constants
81-
Ini=consts.ini
82-
83-
[structs]
84-
Desc="Structures"
85-
Ini=structs.ini
86-
87-
[types]
88-
Desc=Types
89-
Ini=types.ini
90-
91-
[wb]
92-
Desc="TWebBrowser"
93-
Ini=wb.ini

csdb/collection/consts.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# from consts.3.ini
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Constants category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
27

38
[SHIL_Enum]
49
Kind=const

csdb/collection/date.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[AddDays]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Date and Time category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[AddDays]
29
DescEx="<p>Adds the number of days, <var>Days</var>, to the given date, <var>DateTime</var> and returns the result.</p><p>To subtract days, pass a negative value for <var>Days</var>.</p>"
310
Credits="Contributed by Bill Miller."
411
SeeAlso=DiffDays
@@ -1030,8 +1037,6 @@ DelphiXE4=Y
10301037
Delphi10S=Y
10311038
FPC=Y
10321039

1033-
# from date.3.ini
1034-
10351040
[GMTToLocalTime]
10361041
DescEx="<p>Converts the given <var>TDateTime</var> value <var>GMTTime</var> from GMT (UTC) to local time.</p><p>Raises an exception if <var>GMTTime</var> is not valid or can't be converted.</p>"
10371042
Extra="<p><warning>Warning:</warning> This routine requires the Windows NT platform (NT, 2000, XP, Vista etc).</p>"

csdb/collection/drive.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[CurentDrive]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Drive Management category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[CurentDrive]
29
Desc="Returns the letter that identifies the current drive."
310
Credits="Modified from Bill Miller's snippets collection."
411
Snip=352.dat
@@ -135,8 +142,6 @@ DelphiXE4=Y
135142
Delphi10S=Y
136143
FPC=Y
137144

138-
# from drive.3.ini
139-
140145
[DeleteVolumeName]
141146
Desc="Deletes an existing volume label on a given drive. Returns True on success and False on failure."
142147
Extra="<p><warning>Note:</warning> Fails and returns False if the process has insufficient privileges to set the volume name.</p>"

csdb/collection/encoding.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[BytesToAnsiString]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# Encoding category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[BytesToAnsiString]
29
DescEx="Converts the given array of bytes to an ANSI raw byte string, which is returned. The returned string has the code page specified by <var>CodePage</var>."
310
Credits="Based on code from the Stack Overflow posting [How can I convert TBytes to RawByteString?]."
411
Credits_URL="http://stackoverflow.com/questions/773297/how-can-i-convert-tbytes-to-rawbytestring"
@@ -325,8 +332,6 @@ DelphiXE4=Y
325332
Delphi10S=Y
326333
FPC=Y
327334

328-
# from encoding.3.ini
329-
330335
[IsASCIIFile]
331336
DescEx="<p>Checks if file the named by <var>FileName</var> is a valid ASCII text file.</p><p><var>BytesToCheck</var> determines the number of bytes of the file that are to be checked. Specify 0 (the default) to check the whole file.</p><p>The file is read in chunks of <var>BufSize</var> bytes. If this parameter is omitted, the buffer size defaults to 8Kb.</p>"
332337
Extra="<p>It is possible, but unlikely, that an ASCII file could actually be encoded in UTF-7. This is a 7 bit encoding and therefore uses only valid ASCII characters. You can check for this encoding using the <var>IsUTF7File</var> snippet.</p>"

csdb/collection/file.ini

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
[CopyFile]
1+
# DelphiDabbler Code Snippets Database v2
2+
#
3+
# File Management category file
4+
#
5+
# This file is licensed under the MIT license, copyright © 2020 Peter Johnson,
6+
# https://gravatar.com/delphidabbler
7+
8+
[CopyFile]
29
DescEx="Copies <var>Source</var> file to <var>Dest</var> file, preserving modification date."
310
Units=Classes,SysUtils
411
SeeAlso=CopyFiles
@@ -773,8 +780,6 @@ DelphiXE4=Y
773780
Delphi10S=Y
774781
FPC=Y
775782

776-
# from file.3.ini
777-
778783
[CountFiles]
779784
DescEx="<p>Returns the number of files in the folder specified by <var>APath</var> that match the DOS style wildcard <var>AWildCard</var>.</p><p>Any sub-directories of <var>APath</var> and the files they contain are not counted.</p>"
780785
Extra="<p>Slightly modified routine from Bill Miller's snippets collection.</p>"

0 commit comments

Comments
 (0)