2 |
## $Id$ |
## $Id$ |
3 |
## ------------------------------------------------------------------------- |
## ------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.5 2003/04/09 07:22:34 joko |
6 |
|
## childObj2string now inside Encode.pm, renamed to 'twingle_reference' |
7 |
|
## |
8 |
## Revision 1.4 2003/03/27 15:17:07 joko |
## Revision 1.4 2003/03/27 15:17:07 joko |
9 |
## namespace fixes for Data::Mungle::* |
## namespace fixes for Data::Mungle::* |
10 |
## |
## |
30 |
|
|
31 |
require Exporter; |
require Exporter; |
32 |
our @ISA = qw( Exporter ); |
our @ISA = qw( Exporter ); |
33 |
our @EXPORT_OK = qw( &latin_to_utf8 &latin_to_utf8_scalar &utf8_to_latin &utf8_to_latin_scalar ); |
our @EXPORT_OK = qw( |
34 |
|
&latin_to_utf8 |
35 |
|
&latin_to_utf8_scalar |
36 |
|
&utf8_to_latin |
37 |
|
&utf8_to_latin_scalar |
38 |
|
&twingle_reference |
39 |
|
); |
40 |
|
|
41 |
|
|
42 |
use Unicode::String qw(utf8 latin1); |
use Unicode::String qw(utf8 latin1); |
103 |
} |
} |
104 |
} |
} |
105 |
|
|
106 |
|
|
107 |
|
# encodes object-references to serialized string representations |
108 |
|
# made up of: |
109 |
|
# - 'o_<classname>_<ref type>_<guid>'??? |
110 |
|
# - 'o_{guid}_{classname}'!!! |
111 |
|
|
112 |
|
# TODO: enhance further! |
113 |
|
# make it possible to twingle OID-, GUID- and/or other references |
114 |
|
|
115 |
|
sub twingle_reference { |
116 |
|
my $obj = shift; |
117 |
|
my $option = shift; |
118 |
|
my $string = 'n/a'; |
119 |
|
|
120 |
|
#if ($option == 1) { |
121 |
|
if ((my $classname = ref $obj) && (my $guid = $obj->{guid})) { |
122 |
|
$string = join('_', 'o', $guid, $classname); |
123 |
|
} |
124 |
|
#} |
125 |
|
|
126 |
|
return $string; |
127 |
|
} |
128 |
|
|
129 |
|
|
130 |
1; |
1; |
131 |
__END__ |
__END__ |