=encoding euc-jp =head1 NAME =begin original LWP::Protocol - Base class for LWP protocols =end original LWP::Protocol - LWP プロトコルの基底クラス =head1 SYNOPSIS package LWP::Protocol::foo; require LWP::Protocol; @ISA=qw(LWP::Protocol); =head1 DESCRIPTION =begin original This class is used a the base class for all protocol implementations supported by the LWP library. =end original このクラスは LWP ライブラリによりサポートされるすべてのプロトコル実装のための 基底クラスとして使われます。 =begin original When creating an instance of this class using C, and you get an initialised subclass appropriate for that access method. In other words, the LWP::Protocol::create() function calls the constructor for one of its subclasses. =end original C を使ってこのクラスのインスタンスを作成すると、 そのアクセス方法にて記述した、初期化されたサブクラスを取得します。 言い換えると、LWP::Protocol::create() はそのサブクラスの一つのための コンストラクタを呼び出します。 =begin original All derived LWP::Protocol classes need to override the request() method which is used to service a request. The overridden method can make use of the collect() function to collect together chunks of data as it is received. =end original LWP::Protocol から派生したすべてのクラスは、リクエストをサービスするために 使われる request() メソッドをオーバーライドする必要があります。 オーバーライドされたメソッドは、それが受信したときにデータのチャンクを まとめるために collect() 関数を使うことが出来ます。 =begin original The following methods and functions are provided: =end original 以下の関数が提供されます: =over 4 =item $prot = LWP::Protocol->new() =begin original The LWP::Protocol constructor is inherited by subclasses. As this is a virtual base class this method should B be called directly. =end original LWP::Protocol コンストラクタはサブクラスにより継承されます。 これは仮想基底クラスなので、このメソッドは B<直接呼ばれるべきではありません>。 =item $prot = LWP::Protocol::create($scheme) =begin original Create an object of the class implementing the protocol to handle the given scheme. This is a function, not a method. It is more an object factory than a constructor. This is the function user agents should use to access protocols. =end original 与えられた機能を取り扱うプロトコルを実装しているクラスの オブジェクトを作成します。 これは関数であり、メソッドではありません。 これはコンストラクタというより、オブジェクトファクトリです。 これはユーザーエージェントがプロトコルにアクセスするために使うべき 関数です。 =item $class = LWP::Protocol::implementor($scheme, [$class]) =begin original Get and/or set implementor class for a scheme. Returns '' if the specified scheme is not supported. =end original スキームのための実装クラスを取得/設定します。 指定されたスキームがサポートされていなければ、'' を返します。 =item $prot->request(...) $response = $protocol->request($request, $proxy, undef); $response = $protocol->request($request, $proxy, '/tmp/sss'); $response = $protocol->request($request, $proxy, \&callback, 1024); =begin original Dispatches a request over the protocol, and returns a response object. This method needs to be overridden in subclasses. Refer to L for description of the arguments. =end original プロトコルにリクエストを発行し、レスポンスオブジェクトを返します。 このメソッドはサブクラスでオーバーライドされる必要があります。 引数の説明については L を参照してください。 =item $prot->collect($arg, $response, $collector) =begin original Called to collect the content of a request, and process it appropriately into a scalar, file, or by calling a callback. If $arg is undefined, then the content is stored within the $response. If $arg is a simple scalar, then $arg is interpreted as a file name and the content is written to this file. If $arg is a reference to a routine, then content is passed to this routine. =end original リクエストの内容を集め、スカラやファイルへの格納、もしくは コールバックの呼び出しによって適切に処理するために使われます。 $arg が未定義であれば、内容は $response に格納されます。 $arg が単なるスカラであれば、$arg はファイル名と解釈され、内容はこの ファイルに書きこまれます。 $arg がルーチンへのリファレンスであれば、内容はこの関数に渡されます。 =begin original The $collector is a routine that will be called and which is responsible for returning pieces (as ref to scalar) of the content to process. The $collector signals EOF by returning a reference to an empty sting. =end original $collectoer は呼ばれるルーチンです。 そしてそれは処理する内容のカケラを (スカラへのリファレンスとして) 返すことに 責任を持ちます。 $collector は空文字列へのリファレンスを返すことで EOF を知らせます。 =begin original The return value from collect() is the $response object reference. =end original collect() からの返り値は $response オブジェクトリファレンスです。 =begin original B We will only use the callback or file argument if $response->is_success(). This avoids sending content data for redirects and authentication responses to the callback which would be confusing. =end original B<注意:> $response->is_success() であったときだけ、コールバックや ファイル引数を使います。 これによりリダイレクトのためのコンテント・データと混乱をまねくであろう コールバックへの認証レスポンスを送信することを避けています。 =item $prot->collect_once($arg, $response, $content) =begin original Can be called when the whole response content is available as $content. This will invoke collect() with a collector callback that returns a reference to $content the first time and an empty string the next. =end original レスポンスの内容の全体が $content として利用できるときに呼ばれます。 これは最初に $content へのリファレンスを、次に空文字列を返す collector コールバックで collect() を起動します。 =back =head1 SEE ALSO =begin original Inspect the F and F files for examples of usage. =end original 使用例として F と F ファイルを ご覧下さい。 =head1 COPYRIGHT Copyright 1995-2001 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =begin meta Translated: Hippo2000 (5.48) Updated: Kentaro SHIRAKATA (5.813) =end meta