mirror of
https://github.com/php/doc-es.git
synced 2026-03-24 07:22:16 +01:00
132 lines
3.8 KiB
XML
132 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: bfe06c36ec1c0a37909704b292a204195b0bc14f Maintainer: PhilDaiguille Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="quickhashintstringhash.loadfromstring">
|
|
<refnamediv>
|
|
<refname>QuickHashIntStringHash::loadFromString</refname>
|
|
<refpurpose>Este método de fábrica crea un hash a partir de una string</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <modifier>static</modifier> <type>QuickHashIntStringHash</type><methodname>QuickHashIntStringHash::loadFromString</methodname>
|
|
<methodparam><type>string</type><parameter>contents</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>size</parameter><initializer>0</initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
Este método de fábrica crea un nuevo hash a partir de una definición en una string. El
|
|
formato es el mismo que el utilizado en "loadFromFile".
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>contents</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
La string que contiene un formato serializado del hash.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>size</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
La cantidad de listas de buckets a configurar. El número que se pasa será
|
|
automáticamente redondeado a la siguiente potencia de dos. También se limita
|
|
automáticamente de 4 a 4194304.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<simpara>
|
|
Las mismas opciones que el constructor de la clase; excepto que la opción
|
|
size es ignorada. Se calcula automáticamente para ser la misma que el número de
|
|
entradas en el hash, redondeada a la potencia de dos más cercana con un límite máximo de 4194304.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<simpara>
|
|
Devuelve un nuevo QuickHashIntStringHash.
|
|
</simpara>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>Ejemplo de <function>QuickHashIntStringHash::loadFromString</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$contents = file_get_contents( dirname( __FILE__ ) . "/simple.hash" );
|
|
$hash = QuickHashIntStringHash::loadFromString(
|
|
$contents,
|
|
QuickHashIntStringHash::DO_NOT_USE_ZEND_ALLOC
|
|
);
|
|
foreach( range( 0, 0x0f ) as $key )
|
|
{
|
|
printf( "Key %3d (%2x) is %s\n",
|
|
$key, $key,
|
|
$hash->exists( $key ) ? 'set' : 'unset'
|
|
);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen>
|
|
<![CDATA[
|
|
Key 0 ( 0) is unset
|
|
Key 1 ( 1) is set
|
|
Key 2 ( 2) is set
|
|
Key 3 ( 3) is set
|
|
Key 4 ( 4) is unset
|
|
Key 5 ( 5) is set
|
|
Key 6 ( 6) is unset
|
|
Key 7 ( 7) is set
|
|
Key 8 ( 8) is unset
|
|
Key 9 ( 9) is unset
|
|
Key 10 ( a) is unset
|
|
Key 11 ( b) is set
|
|
Key 12 ( c) is unset
|
|
Key 13 ( d) is set
|
|
Key 14 ( e) is unset
|
|
Key 15 ( f) is unset
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|