-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathset.xml
More file actions
114 lines (107 loc) · 3.31 KB
/
set.xml
File metadata and controls
114 lines (107 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?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="quickhashstringinthash.set">
<refnamediv>
<refname>QuickHashStringIntHash::set</refname>
<refpurpose>Este método actualiza una entrada en el hash con un nuevo valor, o
añade una nueva entrada si la entrada no existe</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>QuickHashStringIntHash::set</methodname>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
<methodparam><type>int</type><parameter>value</parameter></methodparam>
</methodsynopsis>
<simpara>
Este método actualiza una entrada con un nuevo valor. Si la entrada
no existía, añadirá una nueva entrada. Devuelve si la entrada
ha sido añadida o actualizada. Si hay claves duplicadas, solo el
primer elemento encontrado será actualizado. Utilice
QuickHashStringIntHash::CHECK_FOR_DUPES al crear el hash para evitar que las claves duplicadas
formen parte del hash.
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<simpara>
La clave de la entrada a añadir o actualizar.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<simpara>
El valor de la entrada a añadir. Si se pasa un valor no string, será
convertido a string automáticamente si es posible.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
2 si la entrada ha sido encontrada y actualizada, 1 si la entrada ha sido nuevamente añadida o 0
si ha habido un error.
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title>Ejemplo de <function>QuickHashStringIntHash::set</function></title>
<programlisting role="php">
<![CDATA[
<?php
$hash = new QuickHashStringIntHash( 1024 );
echo "Set->Add\n";
var_dump( $hash->get( "forty six thousand six hundred ninety two" ) );
var_dump( $hash->set( "forty six thousand six hundred ninety two", 16091 ) );
var_dump( $hash->get( "forty six thousand six hundred ninety two" ) );
echo "Set->Update\n";
var_dump( $hash->set( "forty six thousand six hundred ninety two", 29906 ) );
var_dump( $hash->get( "forty six thousand six hundred ninety two" ) );
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Set->Add
bool(false)
int(2)
int(16091)
Set->Update
int(1)
int(29906)
]]>
</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
-->