Skip to content

Commit

Permalink
GitHub上のソースコードへのリンクを作成
Browse files Browse the repository at this point in the history
  • Loading branch information
shoo committed Dec 25, 2021
1 parent 7d14e01 commit b04e33c
Show file tree
Hide file tree
Showing 38 changed files with 86 additions and 13 deletions.
4 changes: 3 additions & 1 deletion source/array_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
動的配列と静的配列の操作についてまとめます。
要素の初期化、要素の追加、要素の削除、ソート(WIP)、ループ操作(WIP)
Source: $(LINK_TO_SRC source/_array_example.d)
+/
module array_example;

Expand Down Expand Up @@ -93,4 +95,4 @@ unittest
int[] data = buffer.data;

assert(data == [10, 20]);
}
}
2 changes: 2 additions & 0 deletions source/assoc_array_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
連想配列
連想配列の操作についてまとめます。
Source: $(LINK_TO_SRC source/_assoc_array_example.d)
+/
module assoc_array_example;

Expand Down
2 changes: 2 additions & 0 deletions source/concurrency_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
並行処理
`std.concurrency` を使った並行処理の例をまとめます。
Source: $(LINK_TO_SRC source/_concurrency_example.d)
+/
module concurrency_example;

Expand Down
2 changes: 2 additions & 0 deletions source/container_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
コンテナ
スタックやキューなど、いくつかのデータ構造を実現する方法についてまとめます。
Source: $(LINK_TO_SRC source/_container_example.d)
+/
module container_example;

Expand Down
2 changes: 2 additions & 0 deletions source/data/base64_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Base64のエンコードとデコードを行うサンプルです
See_Also:
- https://dlang.org/phobos/std_base64.html
Source: $(LINK_TO_SRC source/data/_base64_example.d)
+/
module data.base64_example;

Expand Down
2 changes: 2 additions & 0 deletions source/data/csv_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ CSV操作
CSVファイル/CSVデータの読み書き等操作を扱います。
ここでは、標準で備えているstd.csvモジュールを用いたCSVファイルの読み込みと、
CSVファイルへの書き出しについて説明します。
Source: $(LINK_TO_SRC source/data/_csv_example.d)
+/
module data.csv_example;

Expand Down
2 changes: 2 additions & 0 deletions source/data/json_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ JSONファイル/JSONデータの読み書き等操作を扱います。
ここでは、標準で備えているstd.jsonモジュールと、その中のJSONValueについて説明します。
このモジュールは、あくまでもJSONが最低限取り扱える程度の機能があって、速度や利便性は二の次です。
ほかにもサードパーティのライブラリとして、asdfを代表として、より高度な取り扱いができるライブラリがあります。
Source: $(LINK_TO_SRC source/data/_json_example.d)
+/
module data.json_example;

Expand Down
1 change: 1 addition & 0 deletions source/data/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $(DL
)
)
Source: $(LINK_TO_SRC source/_data/package.d)
+/
module data;

Expand Down
2 changes: 2 additions & 0 deletions source/datetime_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
時刻・日付
時刻・日付の操作についてまとめます。
Source: $(LINK_TO_SRC source/_datetime_example.d)
+/
module datetime_example;

Expand Down
2 changes: 2 additions & 0 deletions source/exception_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ D言語は「例外機構」をもつ言語です。
例外を捕まえるまで関数呼び出し元をたどっていってスタックをロールバックして…
といった、いわゆる大域ジャンプを伴う、プログラムの特殊なフローのことです。
ここでは例外の使い方についてまとめます。
Source: $(LINK_TO_SRC source/_exception_example.d)
+/
module exception_example;

Expand Down
3 changes: 2 additions & 1 deletion source/file_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ファイル・パス操作についてまとめます。
Source: $(LINK_TO_SRC source/_file_example.d)
+/
module file_example;

Expand Down Expand Up @@ -177,7 +178,7 @@ unittest
`dirEntries` に対して対象とするファイル名の glob パターンを指定します。
See_Also: https://dlang.org/phobos/std_file.html#dirEntries
See_Also: https://dlang.org/phobos/std_file.html#dirEntries
See_Also: https://dlang.org/phobos/std_path.html#.globMatch
+/
unittest
Expand Down
2 changes: 2 additions & 0 deletions source/getopt_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
`std.getopt` の使い方についてまとめます。
実行プログラムの引数を解析することができ、柔軟なプログラム作成を助けます。
Source: $(LINK_TO_SRC source/_getopt_example.d)
+/
module getopt_example;

Expand Down
2 changes: 2 additions & 0 deletions source/is_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
is式
is式についてまとめます。
Source: $(LINK_TO_SRC source/_is_example.d)
+/
module is_example;

Expand Down
2 changes: 2 additions & 0 deletions source/meta_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
メタプログラミング
メタプログラミングに出てくるイディオム等についてまとめます。
Source: $(LINK_TO_SRC source/_meta_example.d)
+/
module meta_example;

Expand Down
2 changes: 2 additions & 0 deletions source/network_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
ネットワークモジュール、特に `std.net.curl` の使い方についてまとめます。
HTTP通信などができます。
Source: $(LINK_TO_SRC source/_network_example.d)
+/
module network_example;

Expand Down
2 changes: 2 additions & 0 deletions source/numeric_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
標準ライブラリで提供される数値計算の関数などについてまとめます。
主に `std.math` や `std.mathspecial`、 `std.numeric` を使った例を対象とします。
Source: $(LINK_TO_SRC source/_numeric_example.d)
+/
module numeric_example;

Expand Down
2 changes: 2 additions & 0 deletions source/opovl_excample.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ D言語では、演算子オーバーロードを定義する際には、もと
See_Also:
- https://dlang.org/spec/operatoroverloading.html
- https://dlang.org/dstyle.html#operator_overloading
Source: $(LINK_TO_SRC source/_opovl_excample.d)
+/
module opovl_excample;

Expand Down
2 changes: 2 additions & 0 deletions source/parallelism_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
並列処理
`std.parallelism` を使った並列処理の例をまとめます。
Source: $(LINK_TO_SRC source/_parallelism_example.d)
+/
module parallelism_example;

Expand Down
2 changes: 2 additions & 0 deletions source/process_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
プロセス
プロセス操作についてまとめます。
Source: $(LINK_TO_SRC source/_process_example.d)
+/
module process_example;

Expand Down
2 changes: 2 additions & 0 deletions source/random_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
乱数
乱数操作についてまとめます。
Source: $(LINK_TO_SRC source/_random_example.d)
+/
module random_example;

Expand Down
2 changes: 2 additions & 0 deletions source/range_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ TODO:
* レンジの種類の紹介
* std.rangeの各関数の紹介
Source: $(LINK_TO_SRC source/_range_example.d)
+/
module range_example;

Expand Down
4 changes: 3 additions & 1 deletion source/regex_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
正規表現
正規表現の操作についてまとめます。
Source: $(LINK_TO_SRC source/_regex_example.d)
+/
module regex_example;

Expand Down Expand Up @@ -51,7 +53,7 @@ module regex_example;
// `escaper`の戻り値は、`Escaper`という遅延評価を行うレンジになります。
// 実行時にstringと連結して新たなパターン文字列を作るような場合、`std.conv.to`や`std.conv.text`を使うと効率的です。
import std.conv : to, text;

string s4 = "^" ~ escaper("https://dlang.org").to!string() ~ "$";
string s5 = text("^", escaper("https://dlang.org"), "$");
assert(s4 == `^https\:\/\/dlang\.org$`);
Expand Down
2 changes: 2 additions & 0 deletions source/string_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
文字列操作についてまとめます。
TODO: 置換(replace), 削除(remove), 分割(split)
Source: $(LINK_TO_SRC source/_string_example.d)
+/
module string_example;

Expand Down
2 changes: 2 additions & 0 deletions source/sync_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
- `Condition`
- `Semaphore` (TODO)
- `Event` (TODO)
Source: $(LINK_TO_SRC source/_sync_example.d)
+/
module sync_example;

Expand Down
2 changes: 2 additions & 0 deletions source/template_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
See_Also:
- https://dlang.org/spec/template.html
Source: $(LINK_TO_SRC source/_template_example.d)
+/
module template_example;

Expand Down
4 changes: 3 additions & 1 deletion source/typecons_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
型を作るユーティリティ
様々な型を作れるtemplateを提供する`std.typecons`パッケージについて解説します。
Source: $(LINK_TO_SRC source/_typecons_example.d)
+/
module typecons_example;

Expand Down Expand Up @@ -168,7 +170,7 @@ unittest

// 新しいリソースを保持するRefCounted!Payloadを、refCounted関数で生成します。
auto rc1 = refCounted(Payload(1234));

// 現在の参照カウントは1です。
assert(rc1.refCountedStore.refCount == 1);

Expand Down
2 changes: 2 additions & 0 deletions source/uda_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
UDA(User Defined Attribute)
UDAの使用例についてまとめます。
Source: $(LINK_TO_SRC source/_uda_example.d)
+/
module uda_example;

Expand Down
2 changes: 2 additions & 0 deletions source/unittests_example.d
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
単体テスト
様々な単体テストの記法についてまとめます。
Source: $(LINK_TO_SRC source/_unittests_example.d)
+/
module unittests_example;

Expand Down
2 changes: 2 additions & 0 deletions subpkg/source/subpkg/test.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/++
サブパッケージの作り方
Source: $(LINK_TO_SRC subpkg/source/subpkg/_test.d)
+/
module subpkg.test;

Expand Down
20 changes: 11 additions & 9 deletions thirdparty/botan/source/botan_usage/example.d
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Botanのライセンスは2条項BSDライセンスで、Apacheライセンス
- APIドキュメント: http://etcimon.github.io/botan/index.html
- Wiki: https://github.com/etcimon/botan/wiki
- C++のほうの公式: https://botan.randombit.net/
Source: $(LINK_TO_SRC thirdparty/botan/source/botan_usage/_example.d)
+/
module botan_usage.example;

Expand Down Expand Up @@ -229,10 +231,10 @@ unittest
import botan.cert.x509.x509_ca: X509CA;
import botan.cert.x509.x509path: x509PathValidate, PathValidationRestrictions, PathValidationResult;
import botan.cert.x509.certstor: CertificateStore, CertificateStoreInMemory;

// 乱数機
auto rng = new AutoSeededRNG;

// 1. ルートCA自己証明書作成
// 1-1 秘密鍵(root)の作成
auto rootPrivateKey = RSAPrivateKey(rng, 2048);
Expand Down Expand Up @@ -262,7 +264,7 @@ unittest
debug (BotanCertFileSave) std.file.write("root-ca-cert.pem.crt", rootCertPEM);
// ルート認証局設立
auto rootCA = X509CA(rootCert, rootPrivateKey, "SHA-256");

// 2. 中間CA証明書作成
// 2-1 秘密鍵(inter)の作成
auto interPrivateKey = RSAPrivateKey(rng, 2048);
Expand All @@ -287,10 +289,10 @@ unittest
auto interCert = rootCA.signRequest(interCsr, rng, interCertOpts.start, interCertOpts.end);
string interCertPEM = interCert.PEM_encode();
debug (BotanCertFileSave) std.file.write("inter-ca-cert.pem.crt", interCertPEM);

// 中間認証局設立
auto interCA = X509CA(interCert, interPrivateKey, "SHA-256");

// 3. サーバー証明書作成
// 3-1 秘密鍵(server)の作成
auto serverPrivateKey = RSAPrivateKey(rng, 2048);
Expand All @@ -315,7 +317,7 @@ unittest
auto serverCert = interCA.signRequest(serverCsr, rng, serverCertOpts.start, serverCertOpts.end);
string serverCertPEM = serverCert.PEM_encode();
debug (BotanCertFileSave) std.file.write("server-cert.pem.crt", serverCertPEM);

// 4. クライアント証明書作成
// 4-1 秘密鍵(client)の作成
auto clientPrivateKey = RSAPrivateKey(rng, 2048);
Expand All @@ -342,16 +344,16 @@ unittest
auto clientCert = interCA.signRequest(clientCsr, rng, clientCertOpts.start, clientCertOpts.end);
string clientCertPEM = clientCert.PEM_encode();
debug (BotanCertFileSave) std.file.write("client-cert.pem.crt", clientCertPEM);

// 証明書ストアを作成
auto store = new CertificateStoreInMemory();
store.addCertificate(rootCert);
store.addCertificate(interCert);

// 5. サーバー証明書(server)を検証
auto serverCertValidation = x509PathValidate(serverCert, PathValidationRestrictions(false), store);
assert(serverCertValidation.successfulValidation);

// 6. クライアント証明書(client)を検証
auto store2 = new CertificateStoreInMemory();
auto clientCertValidation = x509PathValidate(clientCert, PathValidationRestrictions(false), store);
Expand Down
1 change: 1 addition & 0 deletions thirdparty/json/source/asdf_usage/example.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Asdf の特徴として、PhobosのJSONではできない、構造体やクラ
## ドキュメント
http://docs.asdf.dlang.io/index.html
Source: $(LINK_TO_SRC thirdparty/json/source/asdf_usage/_example.d)
+/
module asdf_usage.example;

Expand Down
2 changes: 2 additions & 0 deletions thirdparty/libdparse/source/libdparse_usage/example.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ https://libdparse.dlang.io/
- [dcd](https://code.dlang.org/packages/dcd) : このライブラリでシンボル等を抽出してIDEでオートコンプリートを行うために使われます
- [dfmt](https://code.dlang.org/packages/dfmt) : このライブラリで構文を分解・再構築することでコードスタイルの俗人性を排除します
- [dscanner](https://code.dlang.org/packages/dscanner) : このライブラリで構文を読み取り、静的解析することで、バグを生みやすいコードを警告してくれます
Source: $(LINK_TO_SRC thirdparty/libdparse/source/libdparse_usage/_example.d)
+/
module libdparse_usage.example;

Expand Down
2 changes: 2 additions & 0 deletions thirdparty/vibe-d/source/vibed_usage/_common.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/++
vibe.dのCookbookのサンプルで共通して利用する関数群
Source: $(LINK_TO_SRC thirdparty/vibe-d/source/vibed_usage/__common.d)
+/
module vibed_usage._common;

Expand Down
2 changes: 2 additions & 0 deletions thirdparty/vibe-d/source/vibed_usage/http.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/++
HTTPサーバー
Source: $(LINK_TO_SRC thirdparty/vibe-d/source/vibed_usage/_http.d)
+/
module vibed_usage.http;

Expand Down
Loading

0 comments on commit b04e33c

Please sign in to comment.