strings library [message #63254] |
Sun, 30 September 2007 18:27 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: not.provided.info
where to get strings library to run transformation? strings.asm or
strings.atl is missing in ATL bundle
without it I can't run my transformations, as I use strings
|
|
|
|
Re: strings library [message #63303 is a reply to message #63280] |
Mon, 01 October 2007 11:39 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Dennis Wagelaar![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=dennis.wagelaar%40vub.ac.be) Messages: 147 Registered: July 2009 |
Senior Member |
|
|
x schreef:
> it seems it is already embedded into ATL, explicit declaration is not
> needed anymore
>
AFAIK, the internal strings.asm library is used by the ATL compiler. It
is not included by default, and not meant to be used by end users
either. That said, the ATL native String type supports more operations
than it used to. These are the native String operations (excluding +, <,
>, =, etc.):
Integer size()
String concat(String o)
String substring(Integer start, Integer end)
Integer toInteger()
Real toReal()
Boolean toBoolean()
Sequence toSequence()
String toCString()
String toUpper()
String toLower()
String trim()
Boolean startsWith(String o)
Boolean endsWith(String o)
Integer indexOf(String o)
Integer lastIndexOf(String o)
String regexReplaceAll(String a, String b) {
Sequence split(String a)
String replaceAll(String a, String b)
OclAny readFrom()
Boolean writeTo(String fileName)
Boolean writeToWithCharset(String fileName, String charset)
OclUndefined println()
String toString()
OclAny inject(String targetModelName, String kind, String params)
If you need other string operations, you should probably define them in
your own library. Example:
helper context String def: firstToUpper() : String =
self->substring(1, 1)->toUpper() + self->substring(2, self->size());
--
Dennis
|
|
|
Powered by
FUDForum. Page generated in 0.04666 seconds