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