Subversion Repositories gelsvn

Rev

Rev 107 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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