Lullar    


ビデオジャパンは、最大でランク。

プロパティリスト Plist

提供: フリー百科事典『ウィキペディア(Wikipedia)』 Provided: material may be challenged Wikipedia encyclopedia (Wikipedia) 』

プロパティリスト Plist
拡張子 Extension .plist
開発者 Developers アップルおよびGNUstep And Apple GNUstep,
かつてはNeXT Former NeXT
種別 Article データシリアライゼーション Detashiriaraizeshon
History hen talk table

プロパティリスト (property list)は、 Mac OS X CocoaNeXTSTEPGNUstepなどで利用されるオブジェクト シリアライゼーションのためのファイルである。 Plist (property list) are, Mac OS X Cocoa, NeXTSTEP, GNUstep is a file for Obujekutoshiriaraizeshon used and. また、 .plistという拡張子をもつので、 plistファイルと呼ばれることが多い。 Also,. Plist so with a child that extension, plist files are often called.

プロパティリストはNSPropertyListSerializationクラスによってパースされる。 NSPropertyListSerialization property list to be parsed by the class. プロパティリストが含むことができるのは、FoundationまたはCore Foundationのオブジェクトのみである。 The property list can contain, Foundation or Core Foundation objects only. プロパティリスト全体は配列 ( NSArray )または連想配列 ( NSDictionary )でなければならない。 Entire property list array (NSArray) array or associative (NSDictionary) should be.

実用では、ユーザーの設定を保存するのによく使われる。 In practice, often used to store user preferences. これはWindowsにおけるレジストリと似た使い方である。 The Windows is a similar use of the registry. また、プロパティリストはバンドルの情報を格納するためにも用いられ、以前のMac OSではリソースフォークが近い用途に用いられていた。 The property list is also used to store information about the bundle, old Mac OS had been used in applications in the resource fork is near.

目次 Contents

[ 編集 ] 表現形式 representation

プロパティリストが表現するデータは抽象的なもので、永続化のためのファイルフォーマットは固定されてはいない。 Data represent the property list is abstract in the format file for persistence has not been fixed. 元々、NeXTSTEPでは1つのフォーマットが使われていたが、その後のGNUstepやMac OS Xのフレームワークで異なるフォーマットが誕生した。 Originally, NeXTSTEP was used in one single format, followed by the birth of GNUstep and Mac OS X in the framework of different formats.

[ 編集 ] NeXTSTEP NeXTSTEP

NeXTSTEPにおいては、プロパティリストはヒューマンリーダブルなフォーマットとして設計され、人間が手で編集し、 プログラミング言語風の構文をもつASCIIテキストにシリアライズされた。 NeXTSTEP in the property list is designed as a format that Hyumanridaburu, edit a human hand, with a language-like syntax of programming ASCII text was serialized.

文字列( NSString )は、 String (NSString) is

"This is a plist string" "This is a plist string"

バイナリデータ( NSData )は十六進表記で、 Binary data (NSData) is in hexadecimal notation,

< 54637374 696D67 > <54637374 696D67>

配列は、 Array,

( "one", "two", "three" ) ( "One", "two", "three")

連想配列は、 Associative Arrays

{ (
    "key" = "value"; "key" = "value";
    ... ...
} )

と表記する。 With the notation.

このオリジナルのプロパティリストには制限があり、 NSValue (数値、真偽値など)のオブジェクトは表現できなかった。 This original property list is limited, NSValue (numeric, and boolean) are not represented object.

[ 編集 ] GNUstep GNUstep

GNUstepはNeXTSTEPのフォーマットを採用し、いくつかの拡張を施した。 GNUstep has adopted the format of NeXTSTEP, decorated a few extensions.

  • NSValueをサポートした。 NSValue support. <*INNN>NNNが数値)のように表記する。 <*INNN> NNN numeric) as a notation.
  • NSDate (時刻)をサポートした。 NSDate (time) support. <*DYYYY-MM-DD HH:MM:SS timezone>のように表記する。 <*DYYYY-MM-DD HH:MM:SS timezone> be represented in this way.

GNUstepはまた、後述するMac OS Xのフォーマットも読み書きすることができる。 GNUstep is also later Mac OS X can read and write formats. ( defaults ) (Defaults)

  • GNUstepに付属するツールにplgetなどがある。 Tool that comes with GNUstep plget and others.
$ cat com.example.app.plist | plget key $ Cat com.example.app.plist | plget key
$ cat com.example.app.plist | plget key | plget key $ Cat com.example.app.plist | plget key | plget key

のようにすることでplist内の階層化されたキーに対応する値が取得できる。 Plist that can be obtained as the corresponding value in the hierarchical key.

[ 編集 ] Mac OS X Mac OS X

Mac OS XはNeXTSTEPのフォーマットも扱うことができるが、アップルは別に2つの新しいフォーマットを開発した。 Mac OS X that can handle the formats NeXTSTEP, Apple has developed a new format of two separate one.

Mac OS X 10.0では、NeXTSTEPのフォーマットは非推奨とされ、アップルが定義したDTD [1]を持つ、新しいXMLフォーマットが登場した。 Mac OS X 10.0 does, NeXTSTEP format is deprecated, as defined by Apple DTD [1] with the new XML format appeared.

しかし、XMLは空間効率に問題があるため、 10.2で新しいバイナリフォーマットが登場した。 However, XML is a problem because of space efficiency, 10.2 has appeared in binary format. これは10.4以降のデフォルトのフォーマットとなった。 This is 10.4 and later became the default format.

10.2以降で利用できるplutilユーティリティを使うと、プロパティリストの文法チェックや、フォーマット間の変換が可能となる。 Available in 10.2 or later plutil use the utility, the property list and grammar check, which can be converted between formats.

MacOS XのXMLフォーマットで使われるタグと、それに対応するFoundationのクラスを示す。 MacOS X format of the XML tags used to indicate the corresponding class Foundation. ルート要素は<plist>である。 The root element is <plist> is. また、GNUstepのフォーマットとは多少違いがある。 Addition, GNUstep format and there is little difference.

クラス名 Class Name XMLタグ XML tags
NSString NSString <string> <string>
NSNumber NSNumber <real>, <integer>, <real>, <integer>,
<true />, or <false /> <true />, or <false />
NSDate NSDate <date> <date>
NSData NSData <data> <data>
NSArray NSArray <array> <array>
NSDictionary NSDictionary <dict> <dict>

<dict>の中身は <dict> contents of the

 <dict> <dict>
   <key>key</key> <key> key </ key>
   <string>value</string> <string> value </ string>
 </dict> </ dict>

のように記述する。 Describe as.

[ 編集 ] 外部リンク External links


ビデオジャパンは、最大でランク。




© Lullar