mirror of
https://github.com/php/doc-ja.git
synced 2026-03-24 07:02:08 +01:00
147 lines
4.1 KiB
XML
147 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 906db3b3f78cfa98a7453e3910bcba95bc66d1ee Maintainer: takagi Status: ready -->
|
|
|
|
<refentry xml:id="streamwrapper.stream-read" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>streamWrapper::stream_read</refname>
|
|
<refpurpose>ストリームから読み込む</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type class="union"><type>string</type><type>false</type></type><methodname>streamWrapper::stream_read</methodname>
|
|
<methodparam><type>int</type><parameter>count</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
このメソッドは、<function>fread</function>
|
|
および <function>fgets</function> に対応してコールされます。
|
|
</para>
|
|
<note>
|
|
<para>
|
|
ストリームの読み込み/書き込み位置
|
|
(読み込みに成功したバイト数ぶん) の更新を忘れないようにしましょう。
|
|
</para>
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>count</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
現在位置から何バイトぶんのデータを返すか。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<parameter>count</parameter> バイト未満のデータしか存在しない場合は、
|
|
返せる限りのデータを返します。もうデータがない場合は、空文字列を返します。
|
|
読み込みが失敗した場合は、&false; を返します。
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors"><!-- {{{ -->
|
|
&reftitle.errors;
|
|
&userstream.not.implemented.warning;
|
|
<note>
|
|
<para>
|
|
戻り値が <parameter>count</parameter> より長い場合は
|
|
<constant>E_WARNING</constant> エラーが発生し、余分なデータは失われます。
|
|
</para>
|
|
</note>
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
|
<!--
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>streamWrapper::stream_read</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
/* ... */
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
...
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
-->
|
|
|
|
<refsect1 role="notes"><!-- {{{ -->
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
<methodname>streamWrapper::stream_eof</methodname> は、
|
|
<methodname>streamWrapper::stream_read</methodname> がコールされた後に直接コールされ、
|
|
<acronym>EOF</acronym> に達したかどうかを調べます。実装されていない場合は
|
|
<acronym>EOF</acronym> だとみなされます。
|
|
</para>
|
|
</note>
|
|
<warning>
|
|
<para>
|
|
ファイル全体を (<function>file_get_contents</function> などで)
|
|
読み込む場合、PHP はループ内で
|
|
<methodname>streamWrapper::stream_read</methodname> をコールしてから
|
|
<methodname>streamWrapper::stream_eof</methodname> をコールします。
|
|
しかし、<methodname>streamWrapper::stream_read</methodname>
|
|
が空でない文字列を返す限りは
|
|
<methodname>streamWrapper::stream_eof</methodname>
|
|
の戻り値を無視します。
|
|
</para>
|
|
</warning>
|
|
</refsect1><!-- }}} -->
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>fread</function></member>
|
|
<member><function>fgets</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|