projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set the dictionary encoding of files created by the perl module.
[pspp-builds.git]
/
perl-module
/
lib
/
PSPP.pm
diff --git
a/perl-module/lib/PSPP.pm
b/perl-module/lib/PSPP.pm
index e9e3215dcf753a45b064e324158953198373b9e0..2dccd10a36973e560e8be7d267b92f9bdb918ac1 100644
(file)
--- a/
perl-module/lib/PSPP.pm
+++ b/
perl-module/lib/PSPP.pm
@@
-21,7
+21,7
@@
None by default.
=cut
BEGIN {
=cut
BEGIN {
- $PSPP::VERSION='0.7.
1
';
+ $PSPP::VERSION='0.7.
2
';
require XSLoader;
XSLoader::load('PSPP', $PSPP::VERSION);
}
require XSLoader;
XSLoader::load('PSPP', $PSPP::VERSION);
}
@@
-87,6
+87,10
@@
sub new
=pod
=pod
+=head3 get_var_cnt ()
+
+Returns the number of variables in the dictionary.
+
=head3 get_var ($idx)
Returns the C<idx>th variable from the dictionary.
=head3 get_var ($idx)
Returns the C<idx>th variable from the dictionary.
@@
-193,7
+197,7
@@
package PSPP::Var;
=head3 new ($dict, $name, %input_fmt)
Creates and returns a new variable in the dictionary C<dict>. The
=head3 new ($dict, $name, %input_fmt)
Creates and returns a new variable in the dictionary C<dict>. The
-new variable will have the name C<name>.
+new variable will have the name C<name>.
C<name> must be a valid UTF8 string.
The input format is set by the C<input_fmt> parameter
(See L</PSPP::Fmt>).
By default, the write and print formats are the same as the input format.
The input format is set by the C<input_fmt> parameter
(See L</PSPP::Fmt>).
By default, the write and print formats are the same as the input format.
@@
-222,7
+226,7
@@
sub new
=head3 set_label ($label)
=head3 set_label ($label)
-Sets the variable label to C<label>.
+Sets the variable label to C<label>
, which must be a valid UTF8 string
.
=cut
=cut
@@
-245,7
+249,7
@@
An integer denoting the number of decimal places for the format.
=item width
=item width
-An integer denoting the
number of
width of the format.
+An integer denoting the width of the format.
=back
=back
@@
-278,6
+282,16
@@
sub set_print_format
=pod
=pod
+
+=head3 get_write_format ()
+
+Returns a reference to a hash containing the write format for the variable.
+
+
+=head3 get_print_format ()
+
+Returns a reference to a hash containing the print format for the variable.
+
=head3 set_output_format (%fmt)
Sets the write and print formats to C<fmt>. This is the same as
=head3 set_output_format (%fmt)
Sets the write and print formats to C<fmt>. This is the same as
@@
-308,6
+322,7
@@
Removes all value labels from the variable.
=head3 add_value_label ($key, $label)
Adds the value label C<label> to the variable for the value C<key>.
=head3 add_value_label ($key, $label)
Adds the value label C<label> to the variable for the value C<key>.
+C<label> must be a valid UTF8 string.
On error the subroutine returns zero.
=head3 add_value_labels (@array)
On error the subroutine returns zero.
=head3 add_value_labels (@array)
@@
-334,7
+349,7
@@
sub add_value_labels
=pod
=pod
-=head3 set_value_labels ($key, $
value
)
+=head3 set_value_labels ($key, $
label
)
C<Set_value_labels> is identical to calling L</clear_value_labels>
followed by L</add_value_labels>.
C<Set_value_labels> is identical to calling L</clear_value_labels>
followed by L</add_value_labels>.
@@
-400,6
+415,7
@@
On error, undef is returned.
Appends a case to the system file.
C<Case> is an array of scalars, each of which are the values of
the variables in the dictionary corresponding to the system file.
Appends a case to the system file.
C<Case> is an array of scalars, each of which are the values of
the variables in the dictionary corresponding to the system file.
+If the case contains strings, then the strings must be UTF8 encoded.
The special value C<PSPP::SYSMIS> may be used to indicate that a value
is system missing.
If the array contains less elements than variables in the dictionary,
The special value C<PSPP::SYSMIS> may be used to indicate that a value
is system missing.
If the array contains less elements than variables in the dictionary,
@@
-506,9
+522,9
@@
values retrieved from a reader.
=head3 PSPP::format_value ($value, $variable)
=head3 PSPP::format_value ($value, $variable)
-Returns a scalar containing a string representing C<value> formatted accoring
+Returns a scalar containing a string representing C<value> formatted accor
d
ing
to the print format of C<variable>.
to the print format of C<variable>.
-In the most common us
s
age, C<value> should be a value of C<variable>.
+In the most common usage, C<value> should be a value of C<variable>.
=head3 PSPP::value_is_missing ($value, $variable)
=head3 PSPP::value_is_missing ($value, $variable)