Wed Jun 6 13:09:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
[MPC.git] / modules / WorkspaceHelper.pm
blob6b330d20f8e8c5a30a27ae18572549b6785d4be2
1 package WorkspaceHelper;
3 # ************************************************************
4 # Description : Base class and factory for all workspace helpers
5 # Author : Chad Elliott
6 # Create Date : 9/01/2004
7 # $Id$
8 # ************************************************************
10 # ************************************************************
11 # Pragmas
12 # ************************************************************
14 use strict;
16 # ************************************************************
17 # Data Section
18 # ************************************************************
20 my %required;
22 # ************************************************************
23 # Subroutine Section
24 # ************************************************************
26 sub get {
27 my $type = shift;
29 ## Create the helper name
30 $type =~ s/Creator/Helper/;
31 $type =~ s/=HASH.*//;
33 ## If we can find a helper with this name, we will
34 ## create a singleton of that type and return it.
35 if (!$required{$type}) {
36 foreach my $inc (@INC) {
37 if (-r "$inc/$type.pm") {
38 require "$type.pm";
39 $required{$type} = $type->new();
40 last;
44 ## If we can't find the helper, we just create an
45 ## empty helper and return that.
46 $required{$type} = new WorkspaceHelper() if (!$required{$type});
49 return $required{$type};
53 sub new {
54 my $class = shift;
55 return bless {}, $class;
59 sub modify_value {
60 my($self, $name, $value) = @_;
61 return $value;
65 sub modify_libpath {
66 #my $self = shift;
67 #my $str = shift;
68 #my $reldir = shift;
69 #my $libname = shift;
70 return undef;
74 sub write_settings {
75 #my $self = shift;
76 #my $fh = shift;
77 #my @locals = @_;
78 return 1, undef;
82 sub perform_custom_processing {
83 #my $self = shift;
84 #my $fh = shift;
85 #my $creator = shift;
86 #my $toplevel = shift;