CharacterArray.st
changeset 17468 dea693453518
parent 17442 eccdc56fffa4
child 17484 a73840203e65
equal deleted inserted replaced
17467:d708d65cdca7 17468:dea693453518
   285     ^ EncodingFailedSignal
   285     ^ EncodingFailedSignal
   286 
   286 
   287     "Modified: 28.6.1997 / 20:09:35 / cg"
   287     "Modified: 28.6.1997 / 20:09:35 / cg"
   288     "Created: 3.8.1997 / 18:16:40 / cg"
   288     "Created: 3.8.1997 / 18:16:40 / cg"
   289 ! !
   289 ! !
       
   290 
   290 
   291 
   291 !CharacterArray class methodsFor:'cleanup'!
   292 !CharacterArray class methodsFor:'cleanup'!
   292 
   293 
   293 lowSpaceCleanup
   294 lowSpaceCleanup
   294     "cleanup in low-memory situations"
   295     "cleanup in low-memory situations"
   726      Abstract subclasses must redefine again."
   727      Abstract subclasses must redefine again."
   727 
   728 
   728     ^ self == CharacterArray
   729     ^ self == CharacterArray
   729 ! !
   730 ! !
   730 
   731 
       
   732 
   731 !CharacterArray methodsFor:'Compatibility-ANSI'!
   733 !CharacterArray methodsFor:'Compatibility-ANSI'!
   732 
   734 
   733 addLineDelimiters
   735 addLineDelimiters
   734     "Ansi compatibility - same as withCRs"
   736     "Ansi compatibility - same as withCRs"
   735 
   737 
  4365 
  4367 
  4366     "Modified: / 11-05-2010 / 19:12:37 / cg"
  4368     "Modified: / 11-05-2010 / 19:12:37 / cg"
  4367 ! !
  4369 ! !
  4368 
  4370 
  4369 
  4371 
       
  4372 
       
  4373 
  4370 !CharacterArray methodsFor:'matching - glob expressions'!
  4374 !CharacterArray methodsFor:'matching - glob expressions'!
  4371 
  4375 
  4372 compoundMatch:aString
  4376 compoundMatch:aString
  4373     "like match, but the receiver may be a compound match pattern,
  4377     "like match, but the receiver may be a compound match pattern,
  4374      consisting of multiple simple GLOB patterns, separated by semicolons.
  4378      consisting of multiple simple GLOB patterns, separated by semicolons.
  5048 
  5052 
  5049     "Created: / 08-03-2012 / 03:11:11 / cg"
  5053     "Created: / 08-03-2012 / 03:11:11 / cg"
  5050 ! !
  5054 ! !
  5051 
  5055 
  5052 
  5056 
       
  5057 
  5053 !CharacterArray methodsFor:'padded copying'!
  5058 !CharacterArray methodsFor:'padded copying'!
  5054 
  5059 
  5055 centerPaddedTo:newSize
  5060 centerPaddedTo:newSize
  5056      "return a new string consisting of the receivers characters,
  5061      "return a new string consisting of the receivers characters,
  5057      plus spaces up to length and center the receivers characters in
  5062      plus spaces up to length and center the receivers characters in
  5225         (firstChar isVowel not
  5230         (firstChar isVowel not
  5226         and:[(secondChar isVowel or:[secondChar == $y]) not       
  5231         and:[(secondChar isVowel or:[secondChar == $y]) not       
  5227         and:[thirdChar isVowel not ]]) ifTrue:[
  5232         and:[thirdChar isVowel not ]]) ifTrue:[
  5228             "/ exceptions: 3 non-vowels in a row: looks like an abbreviation
  5233             "/ exceptions: 3 non-vowels in a row: looks like an abbreviation
  5229             (self size > 4) ifTrue:[
  5234             (self size > 4) ifTrue:[
  5230                 (firstChar = $s) ifTrue:[
  5235                 (firstChar == $s) ifTrue:[
  5231                     ((secondChar = $c and:[thirdChar = $r])
  5236                     ((secondChar == $c and:[thirdChar == $r])
  5232                     or:[ (secondChar = $t and:[thirdChar = $r]) ]) ifTrue:[
  5237                     or:[ (secondChar == $t and:[thirdChar == $r]) ]) ifTrue:[
  5233                         (self at:4) isVowel ifTrue:[
  5238                         (self at:4) isVowel ifTrue:[
  5234                             ^ 'a'
  5239                             ^ 'a'
  5235                         ]
  5240                         ]
  5236                     ]
  5241                     ]
  5237                 ].
  5242                 ].
  5708     "
  5713     "
  5709 
  5714 
  5710     "Created: 12.5.1996 / 20:09:29 / cg"
  5715     "Created: 12.5.1996 / 20:09:29 / cg"
  5711     "Modified: 17.4.1997 / 12:50:23 / cg"
  5716     "Modified: 17.4.1997 / 12:50:23 / cg"
  5712 ! !
  5717 ! !
       
  5718 
  5713 
  5719 
  5714 !CharacterArray methodsFor:'special string converting'!
  5720 !CharacterArray methodsFor:'special string converting'!
  5715 
  5721 
  5716 asUnixFilenameString
  5722 asUnixFilenameString
  5717     "return a new string consisting of receiver's characters
  5723     "return a new string consisting of receiver's characters
  6699      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  6705      ('  ' , Character tab asString , ' foo   ') withoutTrailingSeparators inspect
  6700      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  6706      ('   foo' , Character tab asString) withoutTrailingSeparators inspect
  6701     "
  6707     "
  6702 ! !
  6708 ! !
  6703 
  6709 
       
  6710 
  6704 !CharacterArray methodsFor:'substring searching'!
  6711 !CharacterArray methodsFor:'substring searching'!
  6705 
  6712 
  6706 findRangeOfString:subString
  6713 findRangeOfString:subString
  6707     "find a substring. if found, return the start- and endIndex;
  6714     "find a substring. if found, return the start- and endIndex;
  6708      if not found, return an empty interval."
  6715      if not found, return an empty interval."
  7289     "dispatch for visitor pattern; send #visitString:with: to aVisitor"
  7296     "dispatch for visitor pattern; send #visitString:with: to aVisitor"
  7290 
  7297 
  7291     ^ aVisitor visitString:self with:aParameter
  7298     ^ aVisitor visitString:self with:aParameter
  7292 ! !
  7299 ! !
  7293 
  7300 
       
  7301 
  7294 !CharacterArray class methodsFor:'documentation'!
  7302 !CharacterArray class methodsFor:'documentation'!
  7295 
  7303 
  7296 version
  7304 version
  7297     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.567 2015-02-07 15:37:53 cg Exp $'
  7305     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.568 2015-02-13 22:51:17 cg Exp $'
  7298 !
  7306 !
  7299 
  7307 
  7300 version_CVS
  7308 version_CVS
  7301     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.567 2015-02-07 15:37:53 cg Exp $'
  7309     ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.568 2015-02-13 22:51:17 cg Exp $'
  7302 ! !
  7310 ! !
  7303 
  7311 
  7304 
  7312 
  7305 CharacterArray initialize!
  7313 CharacterArray initialize!