Subversion Repositories gelsvn

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 bj 1
package WorkspaceHelper;
2
 
3
# ************************************************************
4
# Description   : Base class and factory for all workspace helpers
5
# Author        : Chad Elliott
6
# Create Date   : 9/01/2004
7
# ************************************************************
8
 
9
# ************************************************************
10
# Pragmas
11
# ************************************************************
12
 
13
use strict;
14
 
15
# ************************************************************
16
# Data Section
17
# ************************************************************
18
 
19
my(%required) = ();
20
 
21
# ************************************************************
22
# Subroutine Section
23
# ************************************************************
24
 
25
sub get {
26
  my($type) = shift;
27
 
28
  ## Create the helper name
29
  $type =~ s/Creator/Helper/;
30
  $type =~ s/=HASH.*//;
31
 
32
  ## If we can find a helper with this name, we will
33
  ## create a singleton of that type and return it.
34
  if (!$required{$type}) {
35
    foreach my $inc (@INC) {
36
      if (-r "$inc/$type.pm") {
37
        require "$type.pm";
38
        $required{$type} = $type->new();
39
        last;
40
      }
41
    }
42
 
43
    ## If we can't find the helper, we just create an
44
    ## empty helper and return that.
45
    if (!$required{$type}) {
46
      $required{$type} = new WorkspaceHelper();
47
    }
48
  }
49
 
50
  return $required{$type};
51
}
52
 
53
 
54
sub new {
55
  my($class) = shift;
56
  my($self)  = bless {
57
                     }, $class;
58
  return $self;
59
}
60
 
61
 
62
sub modify_value {
63
  my($self)  = shift;
64
  my($name)  = shift;
65
  my($value) = shift;
66
  return $value;
67
}
68
 
69
 
70
sub modify_libpath {
71
  #my($self)    = shift;
72
  #my($str)     = shift;
73
  #my($reldir)  = shift;
74
  #my($libname) = shift;
75
  return undef;
76
}
77
 
78
 
79
sub write_settings {
80
  #my($self)   = shift;
81
  #my($fh)     = shift;
82
  #my(@locals) = @_;
83
  return 1, undef;
84
}
85
 
86
 
87
1;