projects
/
irspy-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b29429
)
Introduced methods store_result, _isodate and _string2cdata.
author
Anders S. Mortensen
<sondberg@indexdata.dk>
Mon, 23 Oct 2006 12:22:52 +0000
(12:22 +0000)
committer
Anders S. Mortensen
<sondberg@indexdata.dk>
Mon, 23 Oct 2006 12:22:52 +0000
(12:22 +0000)
lib/ZOOM/IRSpy/Record.pm
patch
|
blob
|
history
diff --git
a/lib/ZOOM/IRSpy/Record.pm
b/lib/ZOOM/IRSpy/Record.pm
index
532603a
..
38641ee
100644
(file)
--- a/
lib/ZOOM/IRSpy/Record.pm
+++ b/
lib/ZOOM/IRSpy/Record.pm
@@
-1,4
+1,4
@@
-# $Id: Record.pm,v 1.16 2006-10-20 14:51:01 mike Exp $
+# $Id: Record.pm,v 1.17 2006-10-23 12:22:52 sondberg Exp $
package ZOOM::IRSpy::Record;
package ZOOM::IRSpy::Record;
@@
-93,6
+93,19
@@
sub append_entry {
$this->_half_decent_appendWellBalancedChunk($nodes[0], $frag);
}
$this->_half_decent_appendWellBalancedChunk($nodes[0], $frag);
}
+sub store_result {
+ my ($this, $type, %info) = @_;
+ my $xml = "<irspy:$type";
+
+ foreach my $key (keys %info) {
+ $xml .= " $key=\"" . $this->_string2cdata($info{$key}) . "\"";
+ }
+
+ $xml .= ">" . $this->_isodate(time()) . "</irspy:$type>\n";
+
+ $this->append_entry('irspy:status', $xml);
+}
+
# *sigh*
#
# *sigh*
#
@@
-145,6
+158,27
@@
sub _half_decent_appendWellBalancedChunk {
}
}
+# Yes, I know that this is already implemented in IRSpy.pm. I suggest that we
+# introduce a toolkit package with such subroutines...
+#
+sub _string2cdata {
+ my ($this, $buffer) = @_;
+ $buffer =~ s/&/&/gs;
+ $buffer =~ s/</</gs;
+ $buffer =~ s/>/>/gs;
+ $buffer =~ s/"/"/gs;
+ $buffer =~ s/'/'/gs;
+
+ return $buffer;
+}
+
+
+sub _isodate {
+ my ($this, $time) = @_;
+ return ZOOM::IRSpy::Test::isodate($time);
+}
+
+
=head1 SEE ALSO
ZOOM::IRSpy
=head1 SEE ALSO
ZOOM::IRSpy