FCL/ja: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | **日本語版メニュー** | |
| 2 | + | --- | |
| 3 | + | [[Main Page/ja|メインページ]] \- [[Lazarus Documentation/ja|Lazarus Documentation日本語版]] \- [[Japanese Localization Notes|翻訳ノート]] \- [[Bug Tracking/ja|日本語障害情報]] | |
| 4 | + | ||
| 5 | + | _Free Component Library_ (FCL)はどのようなプロジェクトでも良く使うコンポーネント(ほとんどはクラス)を提供しているユニットの集合です。 | |
| 2 | 6 | ||
| 3 | - | ||
| 7 | + | それらはDelphiの _Visual Component Library_(VCL)と互換性をもつようにして作られてはいますが、FCLは厳密に、ノンビジュアルなコンポーネントとして設計されています。 また、FCLはVCLよりも優れている部分が多くあります。 (訳注:FCLはGUIやフォームに依存しないものが分離されている。そのためコンソールでも使えるなど応用範囲が広くなっている。FCLでは仕様をはっきりさせようとしており、品質が高く、多くのFPCプロジェクトを支える柱となっている。一方、LCLはGUIやフォームに依存するものが集められOS間でビジュアルな統一をしようとするため、かなり使えるものではあるが、仕様的な統一の難しさがある。) | |
| 4 | 8 | ||
| 5 | - | ||
| 9 | + | 現在の開発状況やりようできるコンポーネントを知るには[Free Component Library](<http://www.freepascal.org/fcl/fcl.html>)を見てください。 | |
| 6 | 10 | ||
| 7 | - | ||
| 11 | + | (Lazarusのこちらのページと一致していない部分があります。 [Reference for 'fcl'](<http://lazarus-ccr.sourceforge.net/docs/fcl/index.html>) ). | |
| 8 | 12 | ||
| 9 | - | ||
| 13 | + | 最新の状況は[ソースリポジトリ](<http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/>)もチェックしてみてください。 いくつかプラットホームに分かれたファイルがあることに注意してください。 | |
| 10 | 14 | ||
| 11 | - | ||
| 15 | + | いくつかのFCLコンポーネントが使われている例を示します。 | |
| 12 | 16 | ||
| 13 | 17 | ### 使い方 | |
| 14 | 18 | ||
| 15 | - | ||
| 19 | + | FCLコンポーネントを使うにはプログラムやユニットのuses節でFCLコンポーネント名を指定します。 デフォルトのコンパイラ設定では、FCLディレクトリがユニットの検索に含まれています。 コマンドラインコンパイラでは適切な検索パスを -Fu<path-to-fcl-units>オプションで指定することができます。 | |
| 16 | 20 | ||
| 17 | 21 | ### サブパッケージ | |
| 18 | 22 | ||
| 19 | - | ||
| 23 | + | 現在(2.2.2以降)では、FCLはいくつかのサブパッケージにわかれています。 | |
| 20 | 24 | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 25 | + | * [[fcl-base]] 基本ユニット | |
| 26 | + | * [[fcl-async]] 非同期I/O | |
| 27 | + | * [[fcl-db]] 一般的なデータベースのサポート+ドライバ | |
| 28 | + | * [[fcl-fpcunit]] ユニットテストフレームワーク | |
| 29 | + | * [[fcl-image/ja]] 画像の読み書き | |
| 30 | + | * [[fcl-json]] javascriptオブジェクトストリーミング | |
| 31 | + | * [[fcl-net]] ネットワーク関連 | |
| 32 | + | * [[fcl-passrc]] パスカルの字句解析 | |
| 33 | + | * [[fcl-process]] プロセス制御 | |
| 34 | + | * [[fcl-registry]] レジストリ | |
| 35 | + | * [[fcl-web]] WEB開発のヘルパー | |
| 36 | + | * [[fcl-xml]] XML (DOM)に関するもの | |
| 37 | + | * [[paszlib]] A Pascal conversion (thus without dependancies) of the standard zlib library. | |
| 34 | 38 | ||
| 35 | 39 | ### 文書 | |
| 36 | 40 | ||
| 37 | - | ||
| 41 | + | 現在のところFCLは文書化されていません。 [Reference for 'fcl'](<http://lazarus-ccr.sourceforge.net/docs/fcl/index.html>)を見ていただき、自由に参加してください。 Delphiと互換性のあるユニットについては、Delphiの文書も参考になるでしょう。 FreePascalのソースファイルはいつでも見れるようになっています。 [source repository](<http://www.freepascal.org/cgi-bin/viewcvs.cgi/trunk/packages/>). | |
| 38 | 42 | ||
| 39 | 43 | ### 例 | |
| 40 | 44 | ||
| 41 | - | ||
| 42 | - | ||
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | - | ||
| 50 | - | ||
| 51 | - | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | - | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - | ||
| 68 | - | ||
| 69 | - | ||
| 70 | - | ||
| 71 | - | ||
| 72 | - | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 45 | + | 次のプログラムはContnrsユニットのTObjectListをFCLで使う例です。 Contnrsユニットはリスト、スタック、キューなどのいろいろなコンテナを提供しています。 | |
| 78 | 46 | ``` | |
| 47 | + | program TObjectListExample; | |
| 48 | + | ||
| 49 | + | uses | |
| 50 | + | Classes, { from RTL for TObject } | |
| 51 | + | Contnrs; { from FCL for TObjectList } | |
| 52 | + | ||
| 53 | + | type | |
| 54 | + | TMyObject = class(TObject) { just some application-specific class } | |
| 55 | + | private | |
| 56 | + | FName: String; { with a string field } | |
| 57 | + | public | |
| 58 | + | constructor Create(AName: String); { and a constructor to create it with a given name } | |
| 59 | + | property Name: String read FName; { and a property to read the name } | |
| 60 | + | end; | |
| 61 | + | ||
| 62 | + | constructor TMyObject.Create(AName: String); | |
| 63 | + | begin | |
| 64 | + | inherited Create; | |
| 65 | + | FName := AName; | |
| 66 | + | end; | |
| 67 | + | ||
| 68 | + | var | |
| 69 | + | VObjectList: TObjectList; { for a list of objects; it is a reference to such a list! } | |
| 70 | + | ||
| 71 | + | begin | |
| 72 | + | VObjectList := TObjectList.Create { create an empty list } | |
| 73 | + | with VObjectList do | |
| 74 | + | begin | |
| 75 | + | Add(TMyObject.Create('Thing One')); | |
| 76 | + | Writeln((Last as TMyObject).Name); | |
| 77 | + | Add(TMyObject.Create('Thing Two')); | |
| 78 | + | Writeln((Last as TMyObject).Name); | |
| 79 | + | end; | |
| 80 | + | end. | |
| 81 | + | ``` | |
| 79 | 82 | ||
| 80 | - | ||
| 83 | + | このプログラムはオブジェクト指向モード(-Mobjfpc や -Mdelphiオプション)でコンパイルします。 | |
| 81 | 84 | ||
| 82 | 85 | ### FCLコンポーネント | |
| 83 | 86 | ||
| 84 | - | ||
| 87 | + | 重複があるので詳しくは記述しませんが、ここでは主要なもののみ記述します。 | |
| 85 | 88 | ||
| 86 | - | ||
| 89 | + | **Classes** | |
| 90 | + | ||
| 87 | 91 | DelphiモードにおけるObjectPascalの拡張の基本クラスです。(訳注:FPCモードでも使える) | |
| 88 | 92 | ||
| 89 | - | ||
| 93 | + | **Contnrs** | |
| 94 | + | ||
| 90 | 95 | いくつかの共通のコンテナクラス | |
| 91 | 96 | ||
| 92 | - | ||
| 93 | - | ||
| 97 | + | **FPCUnit** | |
| 94 | 98 | ||
| 95 | - | ||
| 99 | + | ケント・ベック(Kent Beck)のユニットテストフレームワークがFPCで動作します。(参考:[JUnit](<http://www.junit.org/>)), [documenting article about FPCUnit](<http://www.freepascal.org/docs-html/fpcunit.pdf>) | |
| 100 | + | ||
| 101 | + | **XMLRead, XMLWrite ,DOM** | |
| 102 | + | ||
| 96 | 103 | XMLの読み書きやDOMの詳細[[XML Tutorial]] | |
| 97 | 104 | ||
| 98 | 105 | --- | |
| 99 | - | ||
| 106 | + | *From the Free Pascal wiki, page "FCL/ja", as the Internet Archive kept it on 2025-01-13, last changed on 2020-02-15. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
