⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base.pm

📁 subversion-1.4.3-1.tar.gz 配置svn的源码
💻 PM
字号:
package SVN::Base;=head1 NAMESVN::Base - Base class for importing symbols for svn modules=head1 SYNOPSIS    # Load the svn_ra_* functions into the SVN::Ra namespace.    package SVN::Ra;    use SVN::Base qw(Ra svn_ra_);    # Load svn_config_t structure accessors in the magic namcespace    # provided by swig, so we could use it returned by other functions    package _p_svn_config_t;    use SVN::Base qw(Core svn_config_);=head1 DESCRIPTIONSVN::Base is a module importing the subversion perl bindings rawsymbols created by swig, into proper namespace and make them easier touse.It will also find the accessors for members of a C struct, create ansimpler accessor function like C<$data-E<gt>field()> andC<$data-E<gt>field($new_value)>.Once you understand the convention of subversion functions in perlbindings, you could look at the subversion api and write them in perl.The API is available in the source header files or online athttp://svn.collab.net/svn-doxygen/.=head1 INTERNALSThe perl bindings of swig wraps raw functions into different perlmodules, for example, SVN::_Core, SVN::_Repos. Upon import, SVN::Basebootstrap the requested module if it's not yet loaded, and iterateover the symbols provided in that module, it them puts the functionwith prefix trimmed in the namespace of the caller for this import.The 3rd through the last parameter is a list of symbol endings thatyou wish for SVN::Base not to import into your namespace.  This is usefulfor cases where you may want to import certaion symbols differently thannormally.=head1 CAVEATSSVN::Base consider a function as structure member accessor if it ispostfixed ``_get'' or ``_set''. Real functions with this postfixeswill need extra handling.=cutsub import {    my (undef, $pkg, $prefix, @ignore) = @_;    no warnings 'uninitialized';    unless (${"SVN::_${pkg}::ISA"}[0] eq 'DynaLoader') {	@{"SVN::_${pkg}::ISA"} = qw(DynaLoader);	eval qq'package SVN::_$pkg;require DynaLoader;bootstrap SVN::_$pkg;1;    ' or die $@;    };    my $caller = caller(0);    my $prefix_re = qr/(?i:$prefix)/;    my $ignore_re = join('|', @ignore);    for (keys %{"SVN::_${pkg}::"}) {	my $name = $_;	next unless s/^$prefix_re//;	next if $ignore_re && m/$ignore_re/;	# insert the accessor	if (m/(.*)_get$/) {	    my $member = $1;	    *{"${caller}::$1"} = sub {		&{"SVN::_${pkg}::${prefix}${member}_".		      (@_ > 1 ? 'set' : 'get')} (@_)		  }	}	elsif (m/(.*)_set$/) {	}	else {	    *{"${caller}::$_"} = ${"SVN::_${pkg}::"}{$name};	}    }}=head1 AUTHORSChia-liang Kao E<lt>clkao@clkao.orgE<gt>=head1 COPYRIGHTCopyright (c) 2003 CollabNet.  All rights reserved.This software is licensed as described in the file COPYING, which youshould have received as part of this distribution.  The terms are alsoavailable at http://subversion.tigris.org/license-1.html.  If newerversions of this license are posted there, you may use a newer versioninstead, at your option.This software consists of voluntary contributions made by manyindividuals.  For exact contribution history, see the revision historyand logs, available at http://subversion.tigris.org/.=cut1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -