Class

NSScanner

A string parser that scans for substrings or characters in a character set, and for numeric values from decimal, hexadecimal, and floating-point representations. ある文字列パーサー、それはある文字集合での下位文字列または文字を求めて、そして10進、16進、および浮動小数点表現からの数値を求めて、走査します。

Declaration 宣言

@interface NSScanner : NSObject

Overview 概要

An NSScanner object interprets and converts the characters of an NSString object into number and string values. You assign the scanner’s string when you create the scanner, and the scanner progresses through the characters of that string from beginning to end as you request items. あるNSScannerオブジェクトは、あるNSStringオブジェクトの文字を数および文字列値へと解釈および変換します。あなたはそのスキャナーのもつ文字列を、あなたがスキャナーを作成する時に割り当てます、そしてスキャナーはあなたが項目を要請するときその文字列の文字を始めから終わりまで通して進んでいきます。

Because of the nature of class clusters, a scanner object isn’t an actual instance of the NSScanner class, but is one of its private subclasses. Although a scanner object’s class is private, its interface is public, as declared by this abstract superclass, NSScanner. The objects you create using this class are referred to as scanner objects (and when no confusion will result, merely as scanners). クラスクラスタの性質ゆえに、スキャナーオブジェクトはNSScannerクラスの実際のインスタンスではありません、しかしそれのプライベートなサブクラスのうちの1つです。スキャナーオブジェクトのもつクラスがプライベートであるにもかかわらず、それのインターフェイスはパブリックです、この抽象サブクラス、NSScannerによって宣言されるように。あなたがこのクラスを使って作成するオブジェクトは、スキャナーオブジェクト(そして結果としてどんな混同もない時は、ただ単にスキャナー)として言及されます。

To set an NSScanner object to ignore a set of characters as it scans the string, use the charactersToBeSkipped property. Characters in the skip set are skipped over before the target is scanned. The default set of characters to skip is the whitespace and newline character set. あるNSScannerオブジェクトを、それが文字列をスキャンするときある文字集合を無視するように設定するには、charactersToBeSkippedプロパティを使ってください。省く集合の中の文字は、対象がスキャンされる前に省かれます。スキップする省略時の文字集合は、空白および改行文字集合です。

To retrieve the unscanned remainder of the string, use [[scanner string] substringFromIndex: [scanner scanLocation]]. 保安作用域ブックマークをApp Sandboxをサポートするように作成するには、[[scanner string] substringFromIndex: [scanner scanLocation]]フラグを含めて下さい。

Topics 話題

Creating a Scanner スキャナーを作成する

Getting a Scanner’s String スキャナーのもつ文字列を取得する

Configuring a Scanner スキャナーを構成設定する

Scanning Characters and Strings 文字と文字列を走査する

Scanning Numeric Values 数値を走査する

Monitoring Scanner Progress スキャナー進捗を監視する

Relationships 関係

Inherits From 継承元

Conforms To 次に準拠

See Also 参照

Pattern Matching パターンマッチング