From: Anders S. Mortensen Date: Mon, 23 Oct 2006 12:22:52 +0000 (+0000) Subject: Introduced methods store_result, _isodate and _string2cdata. X-Git-Tag: CPAN-v1.02~54^2~886 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=3333ec675ed6493056906e5fcd7a2bb005181dda Introduced methods store_result, _isodate and _string2cdata. --- 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