[system] / trunk / xmlrpc / RPC / RPC-XML-0.25 / methods / listMethods.code Repository:
ViewVC logotype

View of /trunk/xmlrpc/RPC/RPC-XML-0.25/methods/listMethods.code

Parent Directory Parent Directory | Revision Log Revision Log


Revision 279 - (download) (annotate)
Fri May 17 21:44:04 2002 UTC (17 years, 6 months ago) by gage
File size: 1044 byte(s)
Experimental xmlrpc WeBWorK webservices

    1 ###############################################################################
    2 #
    3 #   Sub Name:       listMethods
    4 #
    5 #   Description:    Read the current list of methods from the server object
    6 #                   and return the names in a list reference.
    7 #
    8 #   Arguments:      NAME      IN/OUT  TYPE      DESCRIPTION
    9 #                   $srv      in      ref       Server object instance
   10 #                   $pat      in      scalar    If passed, a substring to match
   11 #                                                 names against. NOT a regex!
   12 #
   13 #   Globals:        None.
   14 #
   15 #   Environment:    None.
   16 #
   17 #   Returns:        listref
   18 #
   19 ###############################################################################
   20 sub listMethods
   21 {
   22     use strict;
   23 
   24     my $srv = shift;
   25     my $pat = shift;
   26 
   27     my @list = (sort keys %{$srv->{__method_table}});
   28 
   29     # Exclude any that are hidden from introspection APIs
   30     @list = grep(! $srv->{__method_table}->{$_}->{hidden}, @list);
   31     @list = grep(index($_, $pat) != -1, @list) if ($pat);
   32 
   33     \@list;
   34 }

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9