/[suikacvs]/webroot/swe/lib/SWE/DB/SuikaWiki3.pm
Suika

Contents of /webroot/swe/lib/SWE/DB/SuikaWiki3.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Nov 9 06:46:47 2008 UTC (16 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +5 -22 lines
++ swe/lib/SWE/DB/ChangeLog	9 Nov 2008 06:46:33 -0000
2008-11-09  Wakaba  <wakaba@suika.fam.cx>

	* Lock.pm, HashedProps.pm, IDDOM.pm, IDGenerator.pm, IDProps.pm,
	IDText.pm, SuikaWiki3PageList.pm: New modules.

	* SuikaWiki3.pm, SuikaWiki3LastModified.pm: Changed to use plain
	base 16 encoded file name string as key, rather than array
	reference as in SuikaWiki3.

	* SuikaWiki3LastModified.pm (save_data, set_data): Removed.
	(load_data): Renamed as |_load_data|.
	(get_data): Invoke |_load_data| if and only if necessary.

	* SuikaWiki3Props.pm: Don't treat "%" as a part of hash key.

1 package SWE::DB::SuikaWiki3;
2 use strict;
3
4 require Encode::EUCJPSW;
5
6 sub new ($) {
7 my $self = bless {
8 leaf_suffix => '.txt',
9 root_directory_name => ',/',
10 }, shift;
11 return $self;
12 } # new
13
14 sub _get_file_name ($$) {
15 my ($self, $key) = @_;
16
17 return $self->{root_directory_name} . $key . $self->{leaf_suffix};
18 } # _get_file_name
19
20 sub get_data ($$) {
21 my $self = $_[0];
22 my $file_name = $self->_get_file_name ($_[1]);
23
24 return undef unless -f $file_name;
25
26 open my $file, '<:encoding(euc-jp-sw)', $file_name
27 or die "$0: $file_name: $!";
28 local $/ = undef;
29 return scalar <$file>;
30 } # get_data
31
32 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24