PackageId.st
author Claus Gittinger <cg@exept.de>
Fri, 18 Aug 2006 12:23:53 +0200
changeset 9571 01355270af5c
child 9577 03cce2fb9e0a
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9571
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#PackageId
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:'packageIdString'
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'System-Support-Projects'
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!PackageId class methodsFor:'documentation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 2006 by eXept Software AG
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
              All Rights Reserved
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    Represents packageID's.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    Knows the relationship between modules and directories in the package-organization.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
!PackageId class methodsFor:'instance creation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
from: aStringOrSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    ^ self new packageIdString:aStringOrSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "Created: / 18-08-2006 / 12:11:58 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!PackageId methodsFor:'accessing'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
directory
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "return the directory component. Thats the rest after the colon.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
     The module is typically used to define the project-path or project-id within its
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
     sourcecode repository (which is selected via the module)."
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    ^ packageIdString copyFrom:(packageIdString indexOf:$:)+1
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
     (PackageId from:'stx:libbasic') module  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
     (PackageId from:'stx:libbasic') directory  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     (PackageId from:'stx:goodies/xml/stx') module  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
     (PackageId from:'stx:goodies/xml/stx') directory  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    "Created: / 18-08-2006 / 12:15:33 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
module
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "return the module component. Thats the first component up to the colon.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     The module is typically used to select a corresponding sourcecode repository."
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    ^ packageIdString upTo:$:
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
     (PackageId from:'stx:libbasic') module  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
     (PackageId from:'stx:libbasic') directory  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "Created: / 18-08-2006 / 12:13:53 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
packageIdString:something
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    packageIdString := something.
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "Created: / 18-08-2006 / 12:14:45 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
string
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    ^ packageIdString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Created: / 18-08-2006 / 12:20:54 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!PackageId methodsFor:'comparing'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
= aPackageId
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    ^ packageIdString = aPackageId asPackageId string
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
     'stx:libbasic' asPackageId = 'stx:libbasic' asSymbol asPackageId  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
     'stx:libbasic' asPackageId = 'stx:libbasic' asPackageId    
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
     'stx:libbasic2' asPackageId = 'stx:libbasic3' asPackageId  
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    "Created: / 18-08-2006 / 12:20:47 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
hash
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    ^ packageIdString hash
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    "Created: / 18-08-2006 / 12:21:19 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
!PackageId methodsFor:'converting'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
asPackageId
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    ^ self
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "Created: / 18-08-2006 / 12:22:10 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
asString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    ^ packageIdString
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "Created: / 18-08-2006 / 12:12:22 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
asSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    ^ packageIdString asSymbol
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    "Created: / 18-08-2006 / 12:12:29 / cg"
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
! !
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
!PackageId class methodsFor:'documentation'!
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
version
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    ^ '$Header: /cvs/stx/stx/libbasic/PackageId.st,v 1.1 2006-08-18 10:23:53 cg Exp $'
01355270af5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
! !