From 61f9f126dc5bbf732395cf6621fb87536ba0f6be Mon Sep 17 00:00:00 2001 From: "Anders S. Mortensen" Date: Mon, 23 Oct 2006 12:22:52 +0000 Subject: [PATCH] Introduced methods store_result, _isodate and _string2cdata. --- lib/ZOOM/IRSpy/Record.pm | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/ZOOM/IRSpy/Record.pm b/lib/ZOOM/IRSpy/Record.pm index 532603a..38641ee 100644 --- 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; @@ -93,6 +93,19 @@ sub append_entry { $this->_half_decent_appendWellBalancedChunk($nodes[0], $frag); } +sub store_result { + my ($this, $type, %info) = @_; + my $xml = "_string2cdata($info{$key}) . "\""; + } + + $xml .= ">" . $this->_isodate(time()) . "\n"; + + $this->append_entry('irspy:status', $xml); +} + # *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; + + return $buffer; +} + + +sub _isodate { + my ($this, $time) = @_; + return ZOOM::IRSpy::Test::isodate($time); +} + + =head1 SEE ALSO ZOOM::IRSpy -- 1.7.10.4