strings library [message #63254] |
Sun, 30 September 2007 14:27  |
Eclipse User |
|
|
|
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 07:39  |
Eclipse User |
|
|
|
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.27350 seconds