Functions

abort

static Void abort (Int cause, String explanation)
static Void abort (Int cause)

Abort immediately the execution.

The cause value is one of the pcerr_XXXX constant.

If specified, explanation will be used to explain the abort reasons in the Output window.

abs

static Int abs (Int x)
static Float abs (Float x)

Return the absolute value of the x parameter (i.e. it returns x without sign).

acos

static Float acos (Float x)

Returns the inverse value of the cosine function. Returned angles are in radians,

argc

static Int argc ()

Returns the number of arguments on the command line.

argv

static String argv (Int value)

Returns the valueth argument from the command line. Argument #0 is Macrocoder executable.

asin

static Float asin (Float x)

Returns the inverse value of the sine function. Returned angles are in radians,

atan2

Computes the inverse tangent of y/x using the signs of arguments to correctly determine quadrant. All angles are expressed in radians.

static Float atan2 (Float y, Float x)

atan

static Float atan (Float x)

Arc tangent of arg in radians in the range of [-/2; /2] radians.

bitInvert

static Void bitInvert (out Int n, Int flg)

Inverts in parameter n all bits indicated by flg.

// Set n to 00001111
var Int n = 0x0F;

// Numbering the bits 87654321, invert bits 654.
// For this reason we pass as 'flg' a mask where the bits
// we want to invert are set to 1: 00111000 (only bits 6, 5 and 4
// have been set to 1).
// Now let's call the bitInvert function
bitInvert (n, 0b00111000);

// Now bits 4, 5 and 6
// Print the result:
system ().msg << "n=" << String::formatInt (n, 2, 8) << endl;

// Result is: n=00110111

bitIsSet

static Int bitIsSet (Int n, Int flg)

Returns true if all bits specified in flg are set to 1 in n.

bitNoneIsSet

static Int bitNoneIsSet (Int n, Int flg)

Returns true if none of the bits specified in flg are set to 1 in n.

bitReset

static Void bitReset (out Int n, Int flg)

Clear to 0 all the bits of n that have been listed to 1 in flg.

bitSet

static Void bitSet (out Int n, Int flg)

Set to 1 all the bits of n that have been listed to 1 in flg.

castToFloat

static Float castToFloat (Int i)
static Float castToFloat (Huge i)

Convert the given value i into a Float value.

castToInt

static Int castToInt (Float i)
static Int castToInt (Huge i)

Truncate the given value i into a Int value. In case of Float, the decimal part is truncated; in case the value is out of range for an Int, only the lower bits are kept.

ceil

static Float ceil (Float x)

This function returns the smallest integral value not less than x.

chr

static String chr (Int value)

Retuns a string formed of one single character whose UNICODE is value. The first 127 UNICODE characters match the ASCII character set, so this function can be used to convert ASCII values into a string.

cmp

static Int cmp (Int v1, Int v2)
static Int cmp (Huge v1, Huge v2)
static Int cmp (Float v1, Float v2)

Compare v1 with v2. It returns -1 if v1<v2; it returns 0 if v1==v2; it returns 1 if v1>v2.

copyFile

static Void copyFile (String sourceFile, String targetFile)
static Void copyFile (FilePath sourceFile, FilePath targetFile)
static Int copyFileRet (FilePath sourceFile, FilePath targetFile)

Copies file sourceFile to targetFile. Parameter targetFile can be a file name or a directory.

cos

static Float cos (Float x)

Returns the cosine of a radian angle x.

cosh

static Float cosh (Float x)

Returns the hyperbolic cosine of x.

countSetBits

static Int countSetBits (Int n1)

Returns the number of bits set to 1 inside n1., For example, if n1 is 01011110, it returns 5 (i.e. 5 bits are set to 1).

crc32

static Int crc32 (Int s)
static Int crc32 (Int s, Int prevCrc)
static Int crc32 (String s)
static Int crc32 (String s, Int prevCrc)
static Int crc32 (Huge s)
static Int crc32 (Huge s, Int prevCrc)

Calculate the CRC-32 of the given parameter.

CRC-32 of multiple elements can be obtained by feeding the previous CRC-32 to the prevCrc parameter of the following crc32 function.

The example below calculates the CRC-32 of the string "foobar-hello" in two steps:

var Int myCrc;
myCrc = crc32 ("foobar-");
myCrc = crc32 ("hello", myCrc);

currMs

static Huge currMs ()

Returns the current time in milliseconds.

decodeXml

static Int decodeXml (InternalAnyRef obj, Binary xmlData, out String messages, String rootName)

TBD

decodeXml

TBD.

static Int decodeXml (InternalAnyRef obj, String fileName, String rootName)

decodeXml

static Int decodeXml (InternalAnyRef obj, Binary xmlData, String rootName)

TBD

decodeXml

TBD.

static Int decodeXml (InternalAnyRef obj, String fileName, out String messages, String rootName)

deg2rad

static Float deg2rad (Float deg)

Given a value in degrees, returns the same value converted to radians. See also rad2deg.

describeErrorCode

static String describeErrorCode (Int errorCode)

Given an errorCode of the pcerr_XXX family, it returns a textual description of the error.

describeUnicode

static String describeUnicode (Int unicode)

Given an unicode character (an integer in the range 0x0000 to 0xFFFF), it returns a readable description of the character.

dump

static String dump (InternalAnyRef obj)

Returns a string containing all the attributes and values contained by any object. This function is useful to quickly log or display the contents of objects while debugging an implementation.

dynamic

static Int dynamic (out Any obj)

Returns true if an object is dynamic, i.e. it is suitable to be used as a variant or array element.

encodeXml

TBD.

static Int encodeXml (InternalAnyRef obj, String fileName, String rootName)

exp

Returns e raised to the power of x.

static Float exp (Float x)

fileSystemIsCaseSensitive

Returns true if the filesystem is case sensitive, like in UNIX and Linux. Returns false if not case sensitive, like under Windows.

static Int fileSystemIsCaseSensitive ()

fileSystemUsesBackslash

Returns true if the filesystem uses backslash for directory separation (e.g. C:\tmp), like Windows; returns false if it usese slashes (e.g. /usr/bin) like UNIX and Linux.

static Int fileSystemUsesBackslash ()

fitInRange

Force a value "v" to stay in the range "[a,b)". If a>b, the range is intended as "(b,a]". If a==b, the value "v" is forced = a.

static Void fitInRange (out Int v, Int a, Int b)

floor

Returns the largest integer that is smaller than or equal to x (ie: rounds downs the nearest integer).

static Float floor (Float x)

fmod

Returns the remainder when x is divided by y.

static Float fmod (Float x, Float y)

getAbsolutePath

Return the absolute path for the given file starting from the current global directory or empty string in case of error.

static String getAbsolutePath (String anyFileName)

getBitInvert

In n1, invert all bits that are set to 1 in flg.

static Int getBitInvert (Int n1, Int flg)

getBitReset

Returns a value identical to n1 where all bits set to 1 in flg have been zeroed.

static Int getBitReset (Int n1, Int flg)

getBitSet

Returns a value identical to n1 where all bits set to 1 in flg have been set to one.

static Int getBitSet (Int n1, Int flg)

getFileNameFromSourceId

static String getFileNameFromSourceId (Int sourceId)

TBD

getHugeHigher

static Int getHugeHigher (Huge h)

Given a 64-bit Huge value h, it returns its higher 32-bit Int value.

getHugeLower

static Int getHugeLower (Huge h)

Given a 64-bit Huge value h, it returns its lower 32-bit Int value.

getJPEGSize

static Int getJPEGSize (Binary jpeg, out Int width, Int height)

Once a JPEG file has been loaded in binary form in the jpeg object, it returns its width and height in pixels.

getProgramVersion

static String getProgramVersion ()

TBD

getTargetProjectFilePath

Returns the full pathname of the current target project.

static FilePath getTargetProjectFilePath ()

getTargetProjectPath

Returns a string containing the path where the target project is.

For example, if the target project is "C:\MyDir\MyProject\prj.fct", it will return "C:\MyDir\MyProject\" including the trailing slash or backslah.

static String getTargetProjectPath ()

isDir

static Int isDir (String dir)
static Int isDir (FilePath dir)

Returns true if dir exists and it is a directory.

isFile

static Int isFile (String file)
static Int isFile (FilePath file)

Returns true if the given path exists and it is a file (i.e. not a directory).

isLifeCycle

Return true if the object r1 is a lifecycle instance.

static Int isLifeCycle (Any r1)

isSameRef

Returns true if r1 and r2 are actually referring to the same object.

static Int isSameRef (Any r1, Any r2)

join

Joins the given strings together using separator between each one of them.

static String join (array of String strings, String separator)

lc

Returns the lower case version of the given unicode character.

static Int lc (Int unicode)

ldexp

Combines a fraction x and an exponent n into a floating-point value.

static Float ldexp (Float x, Int n)

localize

Returns the combined localized version of formed by s and GLocator loc.

static LocDecoString localize (DecoString s, GLocator loc)
static LocNumeric localize (Numeric s, GLocator loc)
static LocString localize (String s, GLocator loc)
static LocInt localize (Int s, GLocator loc)

log10

Returns the logarithm of x to the base of 10.

static Float log10 (Float x)

log

Returns the logarithm of x to the base of e.

static Float log (Float x)

max

static Int max (Int v1, Int v2)

Returns the highest value among v1 and v2. See also min.

min

static Int min (Int v1, Int v2)

Returns the lowest value among v1 and v2. See also max.

mkDir, mkDirRet

static Void mkDir (String dir)
static Void mkDir (FilePath dir)
static Int mkDirRet (FilePath dir)

Creates the given directory creating also the intermediate directory if missing.

If the given directory already exists, it ends without any error.

In case of error, the mkDir version will abort, while the mkDirRet version will return a pcerr_XXXX constant explaining the result.

modf

static Float modf (Float x, out Float ip)

Breaks value into the integral and fractional parts, each of which has the same sign as the argument. They return the fractional part, and store the integral part (as a floating-point number) in ip.

objid

static String objid (InternalAnyRef obj)

Returns an internal unique object identifier.

objinfo

static String objinfo (Any obj)

Returns technical information about an object. It reports the object type and its internal instance id.

pow

static Float pow (Float x, Float y)

Computes x raised to the power of y.

proportion

static Int proportion (Int a, Int b, Int c)

Executes the proportion a : b = c : x and it returns x.

rad2deg

static Float rad2deg (Float rad)

Given a value in radians, returns the same value converted in degrees. See also deg2rad.

random

static Int random ()

TBD

readXmlRoot

TBD.

static Int readXmlRoot (String fileName, out String rootTag)

rmDir

static Void rmDir (String dir)
static Void rmDir (FilePath dir)
static Int rmDirRet (FilePath dir)

Removes the given directory.

In case of error, the rmDir version will abort, while the rmDirRet version will return a pcerr_XXXX constant explaining the result.

round

static Int round (Float i)

Rounds the floating point value i and it returns its nearest integer.

setHugeHigher

static Void setHugeHigher (out Huge h, Int i)

Given a 64-bit Huge value h, it sets its lower 32-bit using Int value i.

setHugeLower

static Void setHugeLower (out Huge h, Int i)

Given a 64-bit Huge value h, it sets its lower 32-bit using Int value i.

signalError

Signals that some error occurred. Once signalled, Macrocoder will continue till the end of the phase and then it will abort with an error.

static Void signalError ()

sin

Returns the sine of x.

static Float sin (Float x)

sinh

Returns the hyperbolic sine of x.

static Float sinh (Float x)

sortArray

Given the array of String values, it sorts it alphabetically.

If caseUnSensitive is true, comparison will not be case sensitive.

static Void sortArray (out array of String values, Int caseUnSensitive)

sortArray

Sort an array of integers.

static Void sortArray (out array of Int values)

sqrt

Returns the square root of x.

static Float sqrt (Float x)

str

Return the value converted to a String.

static String str (Int value)
static String str (Float value)
static String str (InternalAnyRef value)
static String str (Huge value)

stringValidateIdentifier

static String stringValidateIdentifier (String text)

Verifyes that text is a valid identifier; if so, it will return an empty string. If not, it will return a string explaining why it is not a valid identifier.

stringValidateInteger

static String stringValidateInteger (String text, Int minValue, Int maxValue)

Verifyes that text is a valid integer; if so, it will return an empty string. If not, it will return a string explaining why it is not a valid integer.

stringValidateTypeName

static String stringValidateTypeName (String text)

Verifyes that text is a valid type name; if so, it will return an empty string. If not, it will return a string explaining why it is not a valid type name.

swap

Swap n1 with n2.

static Void swap (out Huge n1, out Huge n2)
static Void swap (out Int n1, out Int n2)
static Void swap (out Float n1, out Float n2)

system

Returns the global System object, from which many resources can be reached.

static ref System system ()

tan

Returns the tangent of x.

static Float tan (Float x)

tanh

Returns the hyperbolic tangent of x.

static Float tanh (Float x)

uc

Returns the uppercase version of the given unicode character.

static Int uc (Int unicode)

valid

Returns true if the indicated reference obj is not null. It can be used to see whether a reference is set or an object returned a valid reference.

static Int valid (InternalAnyRef obj)

Methods

ActiveText::concatenate

ref TextStream ActiveText::concatenate (DecoString s)
ref TextStream ActiveText::concatenate (Int s)
ref TextStream ActiveText::concatenate (Float s)
ref TextStream ActiveText::concatenate (String s)
ref TextStream ActiveText::concatenate (Huge s)
ref TextStream ActiveText::concatenate (IExplain s)
ref TextStream ActiveText::concatenate (Numeric s)
ref TextStream TextStream::concatenate (DecoString s)

See TextStream::concatenate

ActiveText::decIndent

See TextStream::decIndent().

Void ActiveText::decIndent ()

ActiveText::incIndent

See TextStream::incIndent().

Void ActiveText::incIndent ()

ActiveText::linkTopic

Add an hyperlinked string topicString connected to help topic with id topicId.

Void ActiveText::linkTopic (String topicString, Int topicId)

ActiveText::operator<<

ref TextStream ActiveText::operator<< (DecoString s)
ref TextStream ActiveText::operator<< (GIDecoString s)
ref TextStream ActiveText::operator<< (Int s)
ref TextStream ActiveText::operator<< (GIInt s)
ref TextStream ActiveText::operator<< (GINumeric s)
ref TextStream ActiveText::operator<< (Float s)
ref TextStream ActiveText::operator<< (String s)
ref TextStream ActiveText::operator<< (GIString s)
ref TextStream ActiveText::operator<< (Huge s)
ref TextStream ActiveText::operator<< (IExplain s)
ref TextStream ActiveText::operator<< (GLocator gLocator)
ref TextStream ActiveText::operator<< (Numeric s)

See TextStream::operator<<.

ActiveText::resetIndent

See TextStream::resetIndent().

Void ActiveText::resetIndent ()

ActiveText::setIndent

Set the automatic indenting of the output stream.

See incIndent() for more details.

Void ActiveText::setIndent (Int i)

ActiveText::setStream

Inherited from TextStream, not to be used on ActiveText, already bound to the 'Output' pane.

Void ActiveText::setStream (out IStreamOutText s)

ActiveText::write

Void ActiveText::write (Numeric s)
Void ActiveText::write (Huge s, Int base, Int zeroPad)
Void ActiveText::write (DecoString s)
Void ActiveText::write (GIDecoString s)
Void ActiveText::write (Int s)
Void ActiveText::write (GIInt s)
Void ActiveText::write (GINumeric s)
Void ActiveText::write (Float s)
Void ActiveText::write (String s)
Void ActiveText::write (GIString s)
Void ActiveText::write (Huge s)
Void ActiveText::write (IExplain s)
Void ActiveText::write (String s, GLocator gLocator)
Void ActiveText::write (Int s, Int base, Int zeroPad)

See TextStream::write().

Binary::add

Add the given octet n, from 0 to 255, to the Binary object.

Void Binary::add (Int n)

Binary::allocate

The binary buffer is prepared with n elements set to zero.

Void Binary::allocate (Int n)

Binary::clear

Delete all the contents and leave the Binary object empty.

Void Binary::clear ()

Binary::compare

Compare this Binary with other. Return -1 if this < other, 0 if equal, 1 otherwise.

Int Binary::compare (Binary other) const

Binary::extractHex

Extract the given range of the binary data in hex form (lowercase). It returns a string like "a1cfb30094..." representing in ASCII hex values the internal binary data. If the requested length is over the end, it returns the available characters (even empty string).

String Binary::extractHex (Int firstChar, Int length) const

Binary::extractReadable

String Binary::extractReadable (Int firstChar, Int length) const

Extract length octets starting from octet firstChar (first is 0) from this object and print it in a compact readable form.

All octets having an ASCII corresponding character as printed, while other characters are escaped with \xNN, where NN is the hex value of the octet.

Binary::length

Returns the number of octets contained in the Binary object.

Int Binary::length () const

Binary::parseHexString

Int Binary::parseHexString (String hexString)

Decode the text hex string (e.g. "fc2012a9") and saves it in binary form in the Binary object.

Binary::readFromFile

Loads the given file into the Binary object.

Returns one of the pcerr_XXXX constant.

Int Binary::readFromFile (String fileName)

Binary::resize

Resize the buffer. The buffer can be truncated or extended. The extended part is prepared with 0.

Void Binary::resize (Int n)

Binary::writeToFile

Writes the binary data to the indicated file, which will be overwritten.

Returns one of the pcerr_XXXX constant.

Int Binary::writeToFile (String fileName) const

DecoStringDiff::

TBD.

DecoStringDiff::constructor (Int flags, Int size)
DecoStringDiff::constructor (Int flags)
DecoStringDiff::constructor (Int flags, Int size, Int mode)

DecoString::append

Void DecoString::append (DecoString s)
Void DecoString::append (String s, DecoStringDiff diff)
Void DecoString::append (String s, Int flags, Int size, Int mode)
Void DecoString::append (String s)

TBD.

DecoString::appendSubString

TBD.

Void DecoString::appendSubString (DecoString s, Int first, Int length)

DecoString::changeFormat

TBD.

Void DecoString::changeFormat (Int first, Int length, DecoStringDiff diff, Int sync)

DecoString::clear

TBD.

Void DecoString::clear ()

DecoString::compare

TBD.

Int DecoString::compare (DecoString other) const

DecoString::compare

TBD.

Int DecoString::compare (DecoString other, Int len) const

DecoString::compareNoCase

TBD.

Int DecoString::compareNoCase (DecoString other) const

DecoString::compareNoCase

TBD.

Int DecoString::compareNoCase (DecoString other, Int len) const

DecoString::deleteRange

TBD.

Void DecoString::deleteRange (Int first, Int length)

DecoString::extractHomogeneousSequence

Starting at i=first, it finds the first point in the DecoString where the format changes from position i-1 to i. Format at position -1 (when 'first' is specified as 0) is considered with all unset.
It returns:
- the format at i-1 (to be dropped completely)
- the format at i (to be activated completely)
- (as return value) the length of the homogeneus sequence starting at position
If returns 0, no more text is available. In that case, prevFormat is the set of items to be dropped and nextFormat is all reset.

Int DecoString::extractHomogeneousSequence (Int first, out DecoStringDiffFormat prevFormat, out DecoStringDiffFormat nextFormat) const

DecoString::extractLineInString

Extract the line containing the given range and return it.
Parameter "firstOffset" is the distance of "first" from the beginning of the returned string. Parameter "lineNumber" returns the line number considering 1 as the first line.

String DecoString::extractLineInString (Int first, Int length, out Int firstOffset, out Int lineNumber) const

String::find

Int DecoString::find (String s, Int startingFrom) const
Int DecoString::find (String s, Int startingFrom, Int findFlags) const
Int DecoString::findNoCase (String s, Int startingFrom) const

Searches for string s inside the string, starting from position startingFrom. Returns the position or string_NOT_FOUND if not found.

The findFlags parameter is any of the find_XXX flags combined with | (binary or).

The findNoCase version is the same as find with the find_IGNORE_CASE flag set.

DecoString::formatIsHomogeneous

Returns true if all the decostring characters have identical format settings.

Int DecoString::formatIsHomogeneous () const

DecoString::getAt

TBD.

Int DecoString::getAt (Int pos) const

DecoString::getDebugString

TBD.

String DecoString::getDebugString () const

DecoString::getSerializedString

TBD.

String DecoString::getSerializedString () const

DecoString::getSerializedString

TBD.

Void DecoString::getSerializedString (out String s) const

DecoString::getString

TBD.

String DecoString::getString () const

DecoString::getSubDecoString

TBD.

DecoString DecoString::getSubDecoString (Int first, Int length) const

DecoString::getSubString

TBD.

String DecoString::getSubString (Int first, Int length) const

DecoString::indentFollowingLines

TBD.

Void DecoString::indentFollowingLines (Int indent)

DecoString::insert

Void DecoString::insert (Int position, DecoString s)
Void DecoString::insert (Int position, String s)

TBD.

DecoString::insertSubString

TBD.

Void DecoString::insertSubString (Int position, DecoString s, Int first, Int length)

DecoString::length

TBD.

Int DecoString::length () const

DecoString::readFromSerializedString

TBD.

Void DecoString::readFromSerializedString (String s)

DecoString::split

TBD.

Void DecoString::split (out array of DecoString decoStrings, String separator) const

Directory::readDir

TBD.

Int Directory::readDir (FilePath dirPath)

Directory::sortByNameAscending

TBD.

Void Directory::sortByNameAscending ()

Directory::sortByNameDescending

TBD.

Void Directory::sortByNameDescending ()

Directory::sortBySizeAscending

TBD.

Void Directory::sortBySizeAscending ()

Directory::sortBySizeDescending

TBD.

Void Directory::sortBySizeDescending ()

Directory::sortByTimeAscending

TBD.

Void Directory::sortByTimeAscending ()

Directory::sortByTimeDescending

TBD.

Void Directory::sortByTimeDescending ()

DirectoryItem::compareByNameAscending

TBD.

static Int DirectoryItem::compareByNameAscending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::compareByNameDescending

TBD.

static Int DirectoryItem::compareByNameDescending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::compareBySizeAscending

TBD.

static Int DirectoryItem::compareBySizeAscending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::compareBySizeDescending

TBD.

static Int DirectoryItem::compareBySizeDescending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::compareByTimeAscending

TBD.

static Int DirectoryItem::compareByTimeAscending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::compareByTimeDescending

TBD.

static Int DirectoryItem::compareByTimeDescending (DirectoryItem d1, DirectoryItem d2)

DirectoryItem::isDir

TBD.

Int DirectoryItem::isDir () const

FileIn::close

TBD.

Void FileIn::close ()

FileIn::open

TBD.

Void FileIn::open (FilePath fileName)

FileIn::open

TBD.

Void FileIn::open (String fileName)

FileIn::openRet

Int FileIn::openRet (FilePath fileName)
Int FileIn::openRet (String fileName)

Open the given fileName for reading. The operation the function returns a pcerr_XXXX constant explaining the result.

FileIn::read

TBD.

Int FileIn::read (out Binary target, Int maxSize)

FileOut::close

TBD.

Void FileOut::close ()

FileOut::open

TBD.

Void FileOut::open (FilePath fileName)

FileOut::open

TBD.

Void FileOut::open (String fileName)

FileOut::openRet

Int FileOut::openRet (FilePath fileName)
Int FileOut::openRet (String fileName)

Open the given fileName. The operation the function returns a pcerr_XXXX constant explaining the result.

FileOut::write

TBD.

Int FileOut::write (Binary s)

FileOut::writeDecoText

TBD.

Int FileOut::writeDecoText (DecoString s, Int first, Int length)

FileOut::writeText

TBD.

Int FileOut::writeText (String s, Int first, Int length)

constructor of FileOutStream

FileOutStream::constructor (FilePath fileName)

TBD

constructor of FileOutStream

FileOutStream::constructor (String fileName)

TBD

FileOutStream::close

TBD.

Void FileOutStream::close ()

FileOutStream::concatenate

ref TextStream FileOutStream::concatenate (DecoString s)
ref TextStream FileOutStream::concatenate (Int s)
ref TextStream FileOutStream::concatenate (Float s)
ref TextStream FileOutStream::concatenate (String s)
ref TextStream FileOutStream::concatenate (Huge s)
ref TextStream FileOutStream::concatenate (IExplain s)
ref TextStream FileOutStream::concatenate (Numeric s)

See TextStream::concatenate

FileOutStream::decIndent

See TextStream::decIndent().

Void FileOutStream::decIndent ()

FileOutStream::incIndent

See TextStream::incIndent().

Void FileOutStream::incIndent ()

FileOutStream::open

TBD.

Void FileOutStream::open (FilePath fileName)
Void FileOutStream::open (String fileName)

FileOutStream::openRet

Int FileOutStream::openRet (String fileName)
Int FileOutStream::openRet (FilePath fileName)

Open the given fileName for writing. The operation the function returns a pcerr_XXXX constant explaining the result.

FileOutStream::operator<<

ref TextStream FileOutStream::operator<< (DecoString s)
ref TextStream FileOutStream::operator<< (GIDecoString s)
ref TextStream FileOutStream::operator<< (Int s)
ref TextStream FileOutStream::operator<< (GIInt s)
ref TextStream FileOutStream::operator<< (GINumeric s)
ref TextStream FileOutStream::operator<< (Float s)
ref TextStream FileOutStream::operator<< (String s)
ref TextStream FileOutStream::operator<< (GIString s)
ref TextStream FileOutStream::operator<< (Huge s)
ref TextStream FileOutStream::operator<< (IExplain s)
ref TextStream FileOutStream::operator<< (GLocator gLocator)
ref TextStream FileOutStream::operator<< (Numeric s)

See TextStream::operator<<.

FileOutStream::resetIndent

See TextStream::resetIndent().

Void FileOutStream::resetIndent ()

FileOutStream::setIndent

See TextStream::setIndent().

Void FileOutStream::setIndent (Int i)

FileOutStream::setStream

See TextStream::setStream().

Void FileOutStream::setStream (out IStreamOutText s)

FileOutStream::write

Void FileOutStream::write (Numeric s)
Void FileOutStream::write (Huge s, Int base, Int zeroPad)
Void FileOutStream::write (DecoString s)
Void FileOutStream::write (GIDecoString s)
Void FileOutStream::write (Int s)
Void FileOutStream::write (GIInt s)
Void FileOutStream::write (GINumeric s)
Void FileOutStream::write (Float s)
Void FileOutStream::write (String s)
Void FileOutStream::write (GIString s)
Void FileOutStream::write (Huge s)
Void FileOutStream::write (IExplain s)
Void FileOutStream::write (String s, GLocator gLocator)
Void FileOutStream::write (Int s, Int base, Int zeroPad)

See TextStream::write().

FilePath::addNamePart

TBD.

Void FilePath::addNamePart (String namePart)

FilePath::calcCrc

TBD.

Int FilePath::calcCrc (Int dirMode, Int caseMode) const

FilePath::clear

TBD.

Void FilePath::clear ()

FilePath::convertToFullPath

String FilePath::convertToFullPath (String inputFilePath) const

Given a FilePath containing a base path, it returns a string containing the fullpath of inputFilePath. If inputFilePath is already absoulte, it is returned unchanged; otherwise, it is returned calculated relatively to the FilePath.

var FilePath basePath;
basePath.parse ("C:\\tmp");

var String fullPath;
fullPath = basePath.convertToFullPath ("foo\\bar");

FullPath will be set to "C:\tmp\foo\bar".

FilePath::delTopNamePart

TBD.

Void FilePath::delTopNamePart ()

FilePath::dirModeToBackslash

TBD.

static Int FilePath::dirModeToBackslash (Int dirMode)

FilePath::exists

Int FilePath::exists () const

TBD

FilePath::explain

Void FilePath::explain (out TextStream o) const

Internal method used to implement the << operator. Writes on o the stored path in readable mode.

FilePath::fullPath

TBD.

static String FilePath::fullPath (String inputFilePath)

FilePath::getAbsolute

FilePath FilePath::getAbsolute (FilePath basePath) const
FilePath FilePath::getAbsolute () const

Returns a new FilePath containing an absolute path. If this path is already absolute, it is returned as is. If it is relative, it is combined with basePath, which must be absolute, to form an absolute path.

If no basePath is specified, it uses the same as returned by getCurrentPath.

FilePath::getAsString

Returns the content of the FilePath object in a O/S compatible string.

Paramenter entriesToPrint can be set to the number of components to print; for example, if "C:\Dir1\Dir2\File3.txt", a entriesToPrint of 2 will print "C:\Dir1\Dir2". If set to fpth_GET_ALL, all entries will be printed always.

Parameter dirMode can be one of the fpt_DIR_xxxx flags.

String FilePath::getAsString (Int entriesToPrint, Int dirMode) const
String FilePath::getAsString () const

FilePath::getCurrent

TBD.

static FilePath FilePath::getCurrent ()

FilePath::getCurrentUserHome

TBD.

static FilePath FilePath::getCurrentUserHome ()

FilePath::getExtension

TBD.

String FilePath::getExtension () const

FilePath::getInfo

TBD.

Int FilePath::getInfo (out DirectoryItem dirItem)

FilePath::getInstallationPath

TBD.

static FilePath FilePath::getInstallationPath ()

FilePath::getOsPathSeparationSymbol

TBD.

static String FilePath::getOsPathSeparationSymbol ()

FilePath::getPath

FilePath FilePath::getPath () const

Return the file path part of a complete filename.

For example, from "C:\tmp\abc.txt" it returns "C:\tmp".

FilePath::getPathAsString

String FilePath::getPathAsString (Int dirMode) const

Returns the complete path in a String form.
The string is composed using UNIX slashes (/) or Windows backslashes (\) according to the dirMode parameter.

FilePath::getRelative

FilePath FilePath::getRelative (FilePath basePath, Int caseMode) const

Return this path expressed relatively to basePath.

For example, if this path is "C:\foo\bar\text.txt" and basePath is "C:\foo\xyz", this method will return "..\bar\text.txt".

Parameter caseMode is set according to the macro values fpth_CASE_xxx.

FilePath::getTopNamePart

In a file path, it returns the rightmost component. If the file path represents a file name, it returns the file name itself.
For example, if the file path is "C:\first\second\hello.txt", the getTopNamePart method would return "hello.txt".

String FilePath::getTopNamePart () const

FilePath::hasExtension

TBD.

Int FilePath::hasExtension () const

FilePath::isAbsolute

TBD.

Int FilePath::isAbsolute () const

FilePath::isSameFileOf

TBD.

Int FilePath::isSameFileOf (FilePath other) const

FilePath::isValid

TBD.

Int FilePath::isValid () const

FilePath::getAbsolute

Void FilePath::makeAbsolute (FilePath basePath)
Void FilePath::makeAbsolute ()

If this path is not already absolute, it is combined with basePath, which must be absolute, to form an absolute path.

If basePath is not specified, it is taken FilePath::getCurrent ().

FilePath::makeFromString

static FilePath FilePath::makeFromString (String pathString)

Executes the parsing of pathString; if the path in the string can not be parsed, this method aborts automatically.

See also parseRet if a result is needed instead of automatically aborting.

FilePath::mkDir

Void FilePath::mkDir () const

Recursively creates the directory specified by this; all the missing directories are also created.

This method aborts automatically in case of error.

FilePath::mkDirRet

Int FilePath::mkDirRet () const

Recursively creates the directory specified by this path object. All the missing directories are also created.

This method returns a pcerr_XXXX constant explaining the result.

FilePath::parse

TBD.

Void FilePath::parse (String pathString)

FilePath::parseRet

Int FilePath::parseRet (String pathString)

TBD

FilePath::replaceExtension

TBD.

Void FilePath::replaceExtension (String newExtension)

FilePath::rmDir

Void FilePath::rmDir () const

Removes the directory specified by this path object. In case of error, it aborts.

FilePath::rmDirRet

Int FilePath::rmDirRet () const

Removes the directory specified by this path object..

This method returns a pcerr_XXXX constant explaining the result.

FilePath::setCurrentToThis

TBD.

Void FilePath::setCurrentToThis () const

FilePath::setToCurrent

TBD.

Void FilePath::setToCurrent ()

FilePath::setToCurrentUserHome

TBD.

Int FilePath::setToCurrentUserHome ()

FilePath::setToInstallationPath

TBD.

Void FilePath::setToInstallationPath ()

FilePath::uniqueRenumbering

Int FilePath::uniqueRenumbering () const

TBD

GIDecoString::getDecoString

TBD.

DecoString GIDecoString::getDecoString () const

GIDecoString::getLocDecoString

LocDecoString GIDecoString::getLocDecoString () const

TBD

GIDecoString::getLocString

LocString GIDecoString::getLocString () const

TBD

GIDecoString::getLocator

TBD.

GLocator GIDecoString::getLocator () const

GIDecoString::getString

String GIDecoString::getString () const

TBD

GIInt::getInt

TBD.

Int GIInt::getInt () const

GIInt::getLocInt

LocInt GIInt::getLocInt () const

TBD

GIInt::getLocNumeric

LocNumeric GIInt::getLocNumeric () const

TBD

GIInt::getLocator

TBD.

GLocator GIInt::getLocator () const

GIInt::getNumeric

Numeric GIInt::getNumeric () const

TBD

GILocalizable::getLocator

TBD.

GLocator GILocalizable::getLocator () const

GINumeric::getInt

Int GINumeric::getInt () const

TBD

GINumeric::getLocInt

LocInt GINumeric::getLocInt () const

TBD

GINumeric::getLocNumeric

LocNumeric GINumeric::getLocNumeric () const

TBD

GINumeric::getLocator

TBD.

GLocator GINumeric::getLocator () const

GINumeric::getNumeric

TBD.

Numeric GINumeric::getNumeric () const

GIString::getDecoString

DecoString GIString::getDecoString () const

TBD

GIString::getLocDecoString

LocDecoString GIString::getLocDecoString () const

TBD

GIString::getLocString

LocString GIString::getLocString () const

TBD

GIString::getLocator

TBD.

GLocator GIString::getLocator () const

GIString::getString

TBD.

String GIString::getString () const

GLocator::

GLocator::constructor (Int pSourceId, Int pSourceOffset, Int pSourceLength, Int pSourceItemId, Int pSourceSubItemId)

TBD

GLocator::extendTo

TBD.

Void GLocator::extendTo (GLocator otherLocator)

GLocator::posIsValid

TBD.

Int GLocator::posIsValid () const

GLocator::resetToInvalid

TBD.

Void GLocator::resetToInvalid ()

IExplain::explain

TBD.

Void IExplain::explain (out TextStream o) const

IStreamIn::read

TBD.

Int IStreamIn::read (out Binary target, Int maxSize)

IStreamOut::write

TBD.

Int IStreamOut::write (Binary s)

IStreamOutText::writeDecoText

TBD.

Int IStreamOutText::writeDecoText (DecoString s, Int first, Int length)

IStreamOutText::writeText

TBD.

Int IStreamOutText::writeText (String s, Int first, Int length)

IntMap::count

TBD.

Int IntMap::count () const

IntMap::deleteAll

TBD.

Void IntMap::deleteAll ()

IntMap::exists

TBD.

Int IntMap::exists (Int value) const

IntMap::exists

TBD.

Int IntMap::exists (array of Int values) const

IntMap::getAt

TBD.

Int IntMap::getAt (Int value) const

IntMap::set

Void IntMap::set (Int value)
Void IntMap::set (array of Int values)

TBD.

IntMap::unset

TBD.

Void IntMap::unset (Int value)

LocDecoString::getDecoString

TBD.

DecoString LocDecoString::getDecoString () const

LocDecoString::getLocDecoString

LocDecoString LocDecoString::getLocDecoString () const

TBD

LocDecoString::getLocString

LocString LocDecoString::getLocString () const

TBD

LocDecoString::getLocator

TBD.

GLocator LocDecoString::getLocator () const

LocDecoString::getString

String LocDecoString::getString () const

TBD

LocDecoString::set

Set the LocDecoString object reading the data from the input parameter.

Void LocDecoString::set (GIDecoString o)
Void LocDecoString::set (GINumeric o)
Void LocDecoString::set (GIString o)

LocInt::getInt

TBD.

Int LocInt::getInt () const

LocInt::getLocInt

LocInt LocInt::getLocInt () const

TBD

LocInt::getLocNumeric

LocNumeric LocInt::getLocNumeric () const

TBD

LocInt::getLocator

TBD.

GLocator LocInt::getLocator () const

LocInt::getNumeric

TBD.

Numeric LocInt::getNumeric () const

LocInt::set

TBD.

Void LocInt::set (GIInt o)

LocInt::set

TBD.

Void LocInt::set (GINumeric o)

LocNumeric::getInt

Int LocNumeric::getInt () const

TBD

LocNumeric::getLocInt

LocInt LocNumeric::getLocInt () const

TBD

LocNumeric::getLocNumeric

LocNumeric LocNumeric::getLocNumeric () const

TBD

LocNumeric::getLocator

TBD.

GLocator LocNumeric::getLocator () const

LocNumeric::getNumeric

TBD.

Numeric LocNumeric::getNumeric () const

LocNumeric::set

TBD.

Void LocNumeric::set (GINumeric o)

LocString::getDecoString

DecoString LocString::getDecoString () const

TBD

LocString::getLocDecoString

LocDecoString LocString::getLocDecoString () const

TBD

LocString::getLocString

LocString LocString::getLocString () const

TBD

LocString::getLocator

TBD.

GLocator LocString::getLocator () const

LocString::getString

TBD.

String LocString::getString () const

LocString::set

Set the LocString object reading the data from the input parameter.

Void LocString::set (GIString o)
Void LocString::set (GINumeric o)

Numeric::getAsString

Returns the numeric in a readable string form.

String Numeric::getAsString () const

Numeric::getFloat

Returns the internal value converted to a Float.

Float Numeric::getFloat () const

Numeric::getHuge

Returns the internal value converted to a Huge.

Huge Numeric::getHuge () const

Numeric::getInt

Returns the internal value converted to a Int; truncation may occur if internal number is too big.

Int Numeric::getInt () const

Numeric::getType

Returns the type of the contained data among (see numeric_XXX macros

Int Numeric::getType () const

Numeric::isValid

Returns true if the Numeric object contains a valid value.

Int Numeric::isValid () const

Numeric::parse

Parse the value from a string, starting from firstChar and reading no more than length characters. Returns the position of the first not parsed character.

Int Numeric::parse (String s, Int firstChar, Int length)

Numeric::set

Void Numeric::set (Int i)
Void Numeric::set (Float i)
Void Numeric::set (Huge i)

Set the Numeric value.

QuickSortable::qsortCompare

TBD.

Int QuickSortable::qsortCompare (Int n1, Int n2) const

QuickSortable::qsortNoOfElements

TBD.

Int QuickSortable::qsortNoOfElements () const

QuickSortable::qsortSwap

TBD.

Void QuickSortable::qsortSwap (Int n1, Int n2)

QuickSortable::quicksort

TBD.

Void QuickSortable::quicksort ()

StreamOutTrace::writeDecoText

TBD.

Int StreamOutTrace::writeDecoText (DecoString s, Int first, Int length)

StreamOutTrace::writeText

TBD.

Int StreamOutTrace::writeText (String s, Int first, Int length)

StreamableString::concatenate

ref TextStream StreamableString::concatenate (DecoString s)
ref TextStream StreamableString::concatenate (Int s)
ref TextStream StreamableString::concatenate (Float s)
ref TextStream StreamableString::concatenate (String s)
ref TextStream StreamableString::concatenate (Huge s)
ref TextStream StreamableString::concatenate (IExplain s)
ref TextStream StreamableString::concatenate (Numeric s)

See TextStream::concatenate

StreamableString::decIndent

See TextStream::decIndent().

Void StreamableString::decIndent ()

StreamableString::incIndent

See TextStream::incIndent().

Void StreamableString::incIndent ()

StreamableString::operator<<

ref TextStream StreamableString::operator<< (DecoString s)
ref TextStream StreamableString::operator<< (GIDecoString s)
ref TextStream StreamableString::operator<< (Int s)
ref TextStream StreamableString::operator<< (GIInt s)
ref TextStream StreamableString::operator<< (GINumeric s)
ref TextStream StreamableString::operator<< (Float s)
ref TextStream StreamableString::operator<< (String s)
ref TextStream StreamableString::operator<< (GIString s)
ref TextStream StreamableString::operator<< (Huge s)
ref TextStream StreamableString::operator<< (IExplain s)
ref TextStream StreamableString::operator<< (GLocator gLocator)
ref TextStream StreamableString::operator<< (Numeric s)

See TextStream::operator<<.

StreamableString::resetIndent

See TextStream::resetIndent().

Void StreamableString::resetIndent ()

StreamableString::setIndent

See TextStream::setIndent().

Void StreamableString::setIndent (Int i)

StreamableString::setStream

See TextStream::setStream().

Void StreamableString::setStream (out IStreamOutText s)

StreamableString::write

Void StreamableString::write (Numeric s)
Void StreamableString::write (Huge s, Int base, Int zeroPad)
Void StreamableString::write (DecoString s)
Void StreamableString::write (GIDecoString s)
Void StreamableString::write (Int s)
Void StreamableString::write (GIInt s)
Void StreamableString::write (GINumeric s)
Void StreamableString::write (Float s)
Void StreamableString::write (String s)
Void StreamableString::write (GIString s)
Void StreamableString::write (Huge s)
Void StreamableString::write (IExplain s)
Void StreamableString::write (String s, GLocator gLocator)
Void StreamableString::write (Int s, Int base, Int zeroPad)

See TextStream::write().

StreamableString::writeDecoText

TBD.

Int StreamableString::writeDecoText (DecoString s, Int first, Int length)

StreamableString::writeText

TBD.

Int StreamableString::writeText (String s, Int first, Int length)

String::append

Void String::append (String s)

Appends the string s to the end.

var String x = "Hello ";
x.append ("world");
// Now 'x' contains "Hello world"

String::appendSubString

Void String::appendSubString (String s, Int first, Int length)

Append the substring length characters starting from first of s to the end of the target string.
If length is too big, only the available characters are copied.

var String x = "Hello ";
var String y = "my world is nice";
y.appendSubString (y, 3, 5);
// Now 'x' contains "Hello world"

String::calcCrc32

Int String::calcCrc32 () const

Return the CRC-32 of the string.

String::changeCaseToLower

Void String::changeCaseToLower ()

Change the string to lower-case letters.

String::changeCaseToUpper

Void String::changeCaseToUpper ()

Change the string to upper-case letters.

String::clear

Void String::clear ()

Clear the contents of the string, that will become an empty string.

String::compare

Int String::compare (String other) const
Int String::compare (String other, Int len) const

Compare the string with other. Comparison is case sensitive. It returns -1 if this string is smaller than other; 0 if identical; 1 if this string is bigger than other.
If len is specified, only the first len characters of both strings are considered when comparing.

See also compareNoCase for case insensitive comparison.

String::compareNoCase

Int String::compareNoCase (String other) const
Int String::compareNoCase (String other, Int len) const

Compare the string with other. Comparison is not case sensitive. It returns -1 if this string is smaller than other; 0 if identical; 1 if this string is bigger than other.
If len is specified, only the first len characters of both strings are considered when comparing.

See also compare for case sensitive comparison.

String::convertEol

Int String::convertEol (out String target, Int requestedEol) const

Converts the EOL of the current string and writes them to target.
Parameter requestedEol must be set to:

It returns one of among eolCR, eolLF or eolCRLF according to the previous EOL implementation of the input string. If the input string has no EOL, it returns eolUNKNOWN.

String::convertToIdentifier

Returns the string converted to a compact form compatible to C identifiers. Multiple sequences of characters out the range [A-Za-z0-9] characters are converted to underscore (_).
If the resulting string begins with a number, an underscore is automatically prefixed.
The returned string will be an non-empty valid C identifier.
It is not guaranteed that different strings will generated different identifiers (for example "A;B" and "A;,.B" both generate "A_B").

String String::convertToIdentifier () const

String::delete

Void String::delete (Int first, Int len)

Delete the given range within the string. If length is too long, the part from first to the end of the string will be deleted..

String::escapeC

Returns the string encoded with ANSI-C escapes.
For example, the string "That's" will be returned as "That\'s".
In the string both single quote (') and double (") are escaped, so the resulting string can be used in C as a single character and a string.

String String::escapeC () const

String::escapeHTML

Returns the string encoded with HTML escapes (e.g. "&quot;", "&amp;", etc.).

String String::escapeHTML () const

String::escapeJava

Returns the string encoded with Java string escapes.
For example, the string "That's" will be returned as "That\'s".

String String::escapeJava () const

String::escapeURL

Returns a string encoded with URI/URL UTF-8 percent escapes.
For example "my name" will be returned as "my%20name".

String String::escapeURL () const

String::extract

String String::extract (Int from, Int len) const

Returns a substring starting at from and len characters long. Values can safely been specified out of range.

String::extractLine

String String::extractLine (Int first, Int length, out Int firstOffset, out Int lineNumber) const

Extracts and returns the complete lines of this that contain the range starting at first and of length length.

It returns the position where the first line begins (firstOffset) and its lineNumber, calling "1" the frist line.

String::find

Int String::find (String s, Int startingFrom) const
Int String::find (String s, Int startingFrom, Int findFlags) const
Int String::findNoCase (String s, Int startingFrom) const

Searches for string s inside the string, starting from position startingFrom. Returns the position or string_NOT_FOUND if not found.

The findFlags parameter is any of the find_XXX flags combined with | (binary or).

The findNoCase version is the same as find with the find_IGNORE_CASE flag set.

String::formatAnyRef

Returns a string containing a somewhat readable version of any object.

static String String::formatAnyRef (InternalAnyRef value)

String::formatFloat

Formats and returns the given Float value in a readable string.

static String String::formatFloat (Float value)

String::formatHuge

static String String::formatHuge (Huge value, Int base, Int zeroPad)
static String String::formatInt (Int value, Int base, Int zeroPad)

Formats and returns the given Int or Huge value in a readable string.

The base parameter sets the base to be used to display the number. For example, number 123 is formatted as 7B if base 16 is chosen.

Note that negative values are shown only when base 10 is selected; otherwise, the numbers are considered as unsingned of the same number of bits (32-bit unsigned for Int, 64-bit unsigned for Huge).

Parameter base can range from 2 to 36. In case base is greater than 10, the required number of alphabetic letters A..Z will be used.

String::formatUnicode

static String String::formatUnicode (Int value)

Returns a string containing a single character which is the representation of the UNICODE value.

For example, formatUnicode(65) returns a string containing an upper case 'A'.

String::getAsDecoString

DecoString String::getAsDecoString () const

Converts this string into a unformatted DecoString

String::getAt

Int String::getAt (Int pos) const

Returns the UNICODE character at position pos (where 0 is first character). If out of range, it returns kUNICODE_INVALID.

String::getExtension

String String::getExtension () const

Returns the final sequence formed of ".xxx" of a string without the leading dot. It can be used to get the extension of filenames.

String::getLowerCase

String String::getLowerCase () const

Returns a copy of this string changed to lower case.

String::getSubString

String String::getSubString (Int first, Int length) const

Returns a string composed by a substring of this string. The substring is length characters long and it is extracted starting from first (where 0 is the first character.

Range will be automatically fit to the string if too big.

String::getUpperCase

String String::getUpperCase () const

Returns a copy of this string changed to upper case.

String::globMatch

Int String::globMatch (String globString, Int ignoreCase) const

Returns true if this string matches the globString expression.

If ignoreCase is true, case will be ignored while matching.

The globString expression is similar to the glob expressions used by filesystems: character * (star) matches any sequence, while ? (question mark) matches any single character.

String::insert

Void String::insert (Int position, String s)

Insert string s at position in the target string. If position is after the end of the string, s will be appended to the end.

String::insertSubString

Void String::insertSubString (Int position, String s, Int first, Int length)

Insert a portion starting at first and of given length of string s at position in the target string. If position is after the end of the string, s will be appended to the end.

String::length

Int String::length () const

Returns the number of characters contained in the string.

String::readFromFile

Int String::readFromFile (String fileName)

Opens fileName for reading and reads its ASCII contents to this string.

If the reading operation fails (for example, because the file does not exists), the application aborts automatically.

String::replace

Void String::replace (String s, String r)

Searches all the occurences of the s string in this string and replaces them with string r.

String::replaceExtension

Void String::replaceExtension (String newExtension)

Replaces the extension in a file name with newExtension. For example, "file.doc" can be renamed to "file.txt" by specifying "txt" as newExtension.

If the last entry doesn't have an extension, it is simply added.

String::shorten

String String::shorten (Int maxLen) const

Reduce a long string to a shortened version if longer than maxLen characters. Exceeding characters will be removed from the center of the string and replaced by three dots "...".

Special characters (newlines, tabs and so on) will be C-escaped (\n, \t, etc.) for easier reading.

This function can be used to display strings on message windows keeping them to a reasonable length.

String::split

Void String::split (out array of String strings, String separator) const

Splits this string into substrings using separator as the separator string. Resulting split strings are saved to array strings.

String::splitMultiQuoted

Void String::splitMultiQuoted (out array of String strings) const

Splits a string containing a sequence of quoted strings.

For example, a string formed by "foo" "bar" is split into two separate strings.

String::writeToFile

Int String::writeToFile (String fileName) const

Opens fileName for wrriting and writes its contents to it in ASCII form.

If the writing operation fails (for example, because the file is not writable), the application aborts automatically.

StringMap::count

Returns the number of items in the map.

Int StringMap::count () const

StringMap::deleteAll

Clears the contents of the StringMap.

Void StringMap::deleteAll ()

StringMap::exists

Int StringMap::exists (array of String values) const
Int StringMap::exists (String value) const

TBD.

StringMap::getAt

TBD.

String StringMap::getAt (Int position) const

StringMap::set

TBD.

Void StringMap::set (array of String values)

StringMap::set

TBD.

Void StringMap::set (String value)

StringMap::unset

TBD.

Void StringMap::unset (String value)

System::print

TBD.

Void System::print (String s)

System::print

TBD.

Void System::print (String s, GLocator gLocator)

TextStream::

TBD.

TextStream::constructor (out IStreamOutText ostream)

TextStream::concatenate

The concatenate methods are used to write data on the stream.

For example:

system ().msg.concatenate("This is ").concatenate(3+a).concatenate(endl);

See also the << operator that does the same thing with a more readable syntax.

ref TextStream TextStream::concatenate (DecoString s)
ref TextStream TextStream::concatenate (Numeric s)
ref TextStream TextStream::concatenate (Int s)
ref TextStream TextStream::concatenate (Float s)
ref TextStream TextStream::concatenate (String s)
ref TextStream TextStream::concatenate (Huge s)
ref TextStream TextStream::concatenate (IExplain s)

TextStream::decIndent

Decreases the indent level of one tab.

See incIndent() for more details.

Void TextStream::decIndent ()

ActiveText::incIndent

Increases the indent level of one tab. Once called, all output will be written indented by the requested number of tabs.
It can be used for example to indent the text in the generated source files.

system().msg << "Hello" << endl;
system().msg.incIndent();
system().msg << "This is indented" << endl;
system().msg.decIndent();
system().msg << "Goodbye" << endl;

Produces the following output:

Hello
  This is indented
Goodbye

See also decIndent().

Void TextStream::incIndent ()

TextStream::operator<<

ref TextStream TextStream::operator<< (DecoString s)
ref TextStream TextStream::operator<< (GIDecoString s)
ref TextStream TextStream::operator<< (Int s)
ref TextStream TextStream::operator<< (GIInt s)
ref TextStream TextStream::operator<< (GINumeric s)
ref TextStream TextStream::operator<< (Float s)
ref TextStream TextStream::operator<< (String s)
ref TextStream TextStream::operator<< (GIString s)
ref TextStream TextStream::operator<< (Huge s)
ref TextStream TextStream::operator<< (IExplain s)
ref TextStream TextStream::operator<< (GLocator gLocator)
ref TextStream TextStream::operator<< (Numeric s)

Write on the stream.

For example:

system ().msg << "This is " << 3+a << endl;

TextStream::resetIndent

Clear the automatic indenting of the output stream.

See incIndent() for more details.

Void TextStream::resetIndent ()

TextStream::setIndent

Set the automatic indenting of the output stream.

See incIndent() for more details.

Void TextStream::setIndent (Int i)

TextStream::setStream

TBD.

Void TextStream::setStream (out IStreamOutText s)

TextStream::write

Void TextStream::write (Numeric s)
Void TextStream::write (Huge s, Int base, Int zeroPad)
Void TextStream::write (DecoString s)
Void TextStream::write (GIDecoString s)
Void TextStream::write (Int s)
Void TextStream::write (GIInt s)
Void TextStream::write (GINumeric s)
Void TextStream::write (Float s)
Void TextStream::write (String s)
Void TextStream::write (GIString s)
Void TextStream::write (Huge s)
Void TextStream::write (IExplain s)
Void TextStream::write (String s, GLocator gLocator)
Void TextStream::write (Int s, Int base, Int zeroPad)

Write on the stream the given value s.

Time::clear

Reset the time/date object to an "unset" status.

Void Time::clear ()

Time::compare

Compare this date with tx. Returns <0 if this time/date is before tx, ==0 if identical, >0 otherwise.

Int Time::compare (Time tx) const

Time::decompose

Expand the internal date/time in a DecomposedTime object so date/time details (day, month, etc.) can be separately accessed.

DecomposedTime Time::decompose () const

Time::getLocalTZ

Returns the current local timezone in steps of 15 minutes (1=15', 4=+1h, -1=-15' etc.).

static Int Time::getLocalTZ ()

Time::getNowLocal

Set the Time object to the current time as of local time zone.

static Time Time::getNowLocal ()

Time::getNowUTC

Set the Time object to the current time as of UTC time zone.

static Time Time::getNowUTC ()

Time::isValid

Returns true if the object contents are valid.

Int Time::isValid () const

Time::set

Set the Time object by reading the values from a DecomposedTime object. Parameters dayOfWeek and dayOfYear are ignored.

Void Time::set (DecomposedTime decomp)

Time::set

Set the internal date/time by spefying all the separate details.

Void Time::set (Int year, Int month, Int day, Int hours, Int mins, Int secs, Int tz)

Time::setLocal

Set the internal date/time by spefying all the separate details. The timezone value is automatically set to the local tz.

Void Time::setLocal (Int year, Int month, Int day, Int hours, Int mins, Int secs)

Time::setNowLocal

Set the internal date/time to the current local time.

Void Time::setNowLocal ()

Time::setNowUTC

Set the internal date/time to the current UTC time.

Void Time::setNowUTC ()

Time::setUTC

Set the internal date/time by spefying all the separate details. The timezone value is automatically set to the UTC tz.

Void Time::setUTC (Int year, Int month, Int day, Int hours, Int mins, Int secs)

Time::toLocal

Convert the internal date to local timezone.

Time Time::toLocal () const

Time::toUTC

Convert the internal date to UTC timezone.

Time Time::toUTC () const

Constants

endl

Stringendl"\n"End-of-line constant

Constant value representing newline.
Example:

system().msg << "Hello world" << endl;

eolXXX

These constants are used by the String::convertEol method to determine how EOL (end of line) should be implemented.
Remind that some implementations (like MS-DOS and Windows) require lines to be terminated by CR-LF (ASCII 0x0D 0x0A) while others, like UNIX, require a simple LF (0x0A). Macrocoder implements internally EOL with LF (0x0A, "\r").

InteolCR0x00000001 (1)EOL implemented with CR (ASCII 0x0D, "\n")
InteolLF0x00000002 (2)EOL implemented with CR (ASCII 0x0D, "\n")
InteolCRLF0x00000000 (0)EOL implemented with CR (ASCII 0x0D 0x0A, "\r\n")
InteolUNKNOWN0x00000003 (3)EOL implementation unknown

file

Intfile_READ0x00000001 (1)TBD
Intfile_WRITE0x00000002 (2)TBD

TBD.

find_XXX

These constants are used by the String::find method to determine how search has to be execute.

Intfind_IGNORE_CASE0x00000001 (1)ignore case in finding
Intfind_MATCH_WHOLE_WORDS0x00000002 (2)match whole words only

fpth

Intfpth_CASE_AUTO0x00000000 (0)Use the default case relevance of the host O/S (i.e. case sensitive on UNIX, case insensitive on Windows)
Intfpth_CASE_ENFORCE0x00000001 (1)Enforce case
Intfpth_CASE_IGNORE0x00000002 (2)Ignore case

Used by FilePath::getRelative method in the caseMode parameter.

Path slash/backslash representation

Intfpth_DIR_AUTO0x00000000 (0)Automatically use backslash on Windows and slash on UNIX-like o/s
Intfpth_DIR_BACKSLASH0x00000002 (2)Use Windows backslash (\)
Intfpth_DIR_SLASH0x00000001 (1)Use UNIX slash (/)

Used by FilePath::getPathAsString method.

fpth_GET_ALL

Intfpth_GET_ALL0xFFFFFFFF (-1)Returns all entries of the path.

Used by the FilePath::getAsString() method.

kDECODIFF

IntkDECODIFF_BOLD0x00000001 (1)Use bold font
IntkDECODIFF_FIXED0x00000008 (8)Use fixed-size (non proportional) font
IntkDECODIFF_ITALIC0x00000002 (2)Use italic font
IntkDECODIFF_UNDERLINE0x00000004 (4)Activate underlineing
IntkDECODIFF_MODE_CODE0x00000000 (0)Color the text as "code"
IntkDECODIFF_MODE_COMMENT0x00000002 (2)Color the text as "comment"
IntkDECODIFF_MODE_FREETEXT0x00000001 (1)Color the text as "freetext"

Macros used by the DecoStringDiff::diffMode attribute and other related methods.

kSTATUS

IntkUNICODE_INVALID0x0000FFFF (65535)Invalid UNICODE value - returned by some functions to represent failure

UNICODE values.

maxFloat

FloatmaxFloat1.7e+308Maximum Float value (1.7E+308)

Maximum value that can be assigned to a Float type.

maxInt

IntmaxInt0x7FFFFFFF (2147483647)Maximum Int value (0x7FFFFFFF, 2147483647)

Maximum value that can be assigned to a Int type.

minFloat

FloatminFloat-1.7e+308Minimum Float value (-1.7E+308)

Minimum value that can be assigned to a Float type.

minInt

IntminInt0x80000000 (-2147483648)Maximum Int value (-2147483648)

Minimum value that can be assigned to a Int type.

numeric

Intnumeric_FLOAT0x00000003 (3)Numeric is a Float
Intnumeric_HUGE0x00000002 (2)Numeric is a Huge
Intnumeric_INT0x00000001 (1)Numeric is an Int
Intnumeric_NONE0x00000000 (0)Numeric is invalid or not set

Returned by the Numeric::getType() method.

pcerr

These constants are returned by many functions to describe the operation results.

Intpcerr_OK0x00000000 (0)No error. This is the value returned upon succesful requests.
Intpcerr_ABORTED0x00000008 (8)Execution aborted after invocation of the abort command.
Intpcerr_ABSTRACT_VIRTUAL0x00000003 (3)Abstract (unimplemented) function invoked.
Intpcerr_ACCESS_DENIED0x00000015 (21)Access to the requested file has been denied (already in use, missing rights, etc.)
Intpcerr_ADD_INVALID_TO_CAULDRON0x0000000C (12)Added an invalid object to the cauldron using the "lset.enroll" function.
Intpcerr_ADD_OWNED_TO_CAULDRON0x0000000B (11)Attempted to add an owned object to the cauldron (lset.enroll); an object is owned if it is an attribute or an object already owned by an array or a variant.
Intpcerr_ARRAY_OUT_OF_RANGE0x00000001 (1)Trying to access an array element out of the array range.
Intpcerr_ASSERTION_FAILED0x00000007 (7)An assert(e) statement failed (expression e is false).
Intpcerr_COMPILE_ERROR0xFFFFFFFA (-6)Compilation error.
Intpcerr_DIR_ALREADY_EXISTS0x00000014 (20)Attempted to create a directory that already exists
Intpcerr_DIR_LINKS_LOOP0x00000016 (22)Loop found in symlinks
Intpcerr_DIR_NOT_EMPTY0x0000001C (28)The directory can not be removed/modified because it is not empty
Intpcerr_DIR_TO_MANY_LINKS0x00000017 (23)Too many links
Intpcerr_DIVISION_BY_ZERO0x0000000E (14)A division by zero has been executed.
Intpcerr_FILE_IS_CLOSED0xFFFFFFFC (-4)Attempted to access a file that has been closed.
Intpcerr_FILE_NOT_FOUND0xFFFFFFFE (-2)The requested file was not found.
Intpcerr_INVALID_CAST0x00000005 (5)Cast can not be executed.
Intpcerr_INVALID_DIAGRAM0x00000012 (18)The object is not a diagram.
Intpcerr_INVALID_ENV0x00000009 (9)Invalid environment.
Intpcerr_INVALID_FILE_EXTENSION0x00000011 (17)File extension is unknown.
Intpcerr_INVALID_FILENAME0xFFFFFFFD (-3)Given filename contains invalid characters.
Intpcerr_LIFESET_LOOP_FOUND0x0000000D (13)Lifesets have been specified forming a creation loop
Intpcerr_NAME_TOO_LONG0x00000018 (24)Name too long
Intpcerr_NOS_PC0x00000019 (25)TBD
Intpcerr_NOT_DIR0x0000001A (26)The requested resource is not a directory
Intpcerr_NOT_XML_FILE0xFFFFFFF9 (-7)The given file is not XML.
Intpcerr_NULL_REFERENCE0x00000004 (4)Accessed a NULL reference
Intpcerr_READ_ONLY_FILE_SYSTEM0x0000001B (27)Read only file system
Intpcerr_STACK_OVEFLOW0x00000006 (6)Stack overflow: too many nested function calls have been executed.
Intpcerr_UNBOUND_ITERATOR0x00000002 (2)N/A
Intpcerr_UNKNOWN_ERROR0xFFFFFFFF (-1)Unknown error
Intpcerr_UNMANAGED_EXCEPTION0x0000000F (15)N/A
Intpcerr_USER_ERROR0x00000013 (19)Generic user-defined error
Intpcerr_VARIANT_IS_STATIC0x0000000A (10)N/A
Intpcerr_VCPU_BUSY0x00000010 (16)N/A
Intpcerr_XML_ERROR0xFFFFFFFB (-5)Error parsing the XML file.
Intpcerr_OTHER_ERROR0xFFFFFFF8 (-8)Other errors.

pi

Floatpi3.14159Mathematical PI constant.

string

Intstring_NOT_FOUND0xFFFFFFFF (-1)

Value returned by find functions when no match is found.

true/false

Inttrue0x00000001 (1)Non-zero value, representing "true" boolean condition
Intfalse0x00000000 (0)Zero value, representing "false" boolean condition

Macrocoder does not have a dedicated "boolean" type but uses the "Int" for boolean operations. These two constants simply represent the two Int values used for the true and the false boolean condition.

DirectoryItem::fDIR

IntfDIR0x00000001 (1)The directory item is a directory

Flags used in the DirectoryItem::flags attribute.

Attributes

CommandLine::cmdLineEntries

ref array of CommandLineEntry CommandLine::cmdLineEntries

TBD.

CommandLine::cmdLineKeyLookup

ref lookup_s of CommandLineEntry CommandLine::cmdLineKeyLookup

TBD.

CommandLineEntry::cmdLineKey

ref String CommandLineEntry::cmdLineKey

TBD.

CommandLineEntry::cmdLineValues

ref array of String CommandLineEntry::cmdLineValues

TBD.

DecoStringDiff::diffFlags

ref Int DecoStringDiff::diffFlags

TBD.

DecoStringDiff::diffMode

ref Int DecoStringDiff::diffMode

Set the mode (bold, italic, etc.) by combininig various flags. See kDECODIFF_xxx constant values for details.

DecoStringDiff::diffSize

ref Int DecoStringDiff::diffSize

Indicates the relative change of the size from the default font size. Negative values make the font smaller, while positive make it bigger.

DecoStringDiffFormat::bold

ref Int DecoStringDiffFormat::bold

TBD.

DecoStringDiffFormat::deltaSize

ref Int DecoStringDiffFormat::deltaSize

TBD.

DecoStringDiffFormat::fixed

ref Int DecoStringDiffFormat::fixed

TBD.

DecoStringDiffFormat::italic

ref Int DecoStringDiffFormat::italic

TBD.

DecoStringDiffFormat::underline

ref Int DecoStringDiffFormat::underline

TBD.

DecomposedTime::day

ref Int DecomposedTime::day

Day, 1..31

DecomposedTime::dayOfWeek

ref Int DecomposedTime::dayOfWeek

No. of day in the week, where 0=Sunday, 1=Monday, ..., 6=Saturday.
This value is calculated by the Time::decompose method; it is ignored by the Time::set method.

DecomposedTime::dayOfYear

ref Int DecomposedTime::dayOfYear

No. of day in the year, where 0=first day of the year, 364=last for non leaps.
This value is calculated by the Time::decompose method; it is ignored by the Time::set method.

DecomposedTime::hours

ref Int DecomposedTime::hours

Hours, 0..23

DecomposedTime::microsecs

ref Int DecomposedTime::microsecs

Microseconds, 0..999999

DecomposedTime::mins

ref Int DecomposedTime::mins

Minutes, 0..59

DecomposedTime::month

ref Int DecomposedTime::month

Month, 1..12

DecomposedTime::secs

ref Int DecomposedTime::secs

Seconds, 0..59

DecomposedTime::tz

ref Int DecomposedTime::tz

Timezone, in steps of 15 minutes (1=15', 4=+1h, -1=-15' etc.)

DecomposedTime::year

ref Int DecomposedTime::year

Four digit year (for example, 2016).

Directory::items

ref array of DirectoryItem Directory::items

TBD.

DirectoryItem::fileName

ref String DirectoryItem::fileName

TBD.

DirectoryItem::flags

ref Int DirectoryItem::flags

TBD.

DirectoryItem::modTime

ref Time DirectoryItem::modTime

TBD.

DirectoryItem::size

ref Huge DirectoryItem::size

TBD.

FileOutStream::fileOut

ref FileOut FileOutStream::fileOut

TBD.

GLocator::sourceId

ref Int GLocator::sourceId

Within a GLocator, it identifies the source file.

GLocator::sourceItemId

ref Int GLocator::sourceItemId

Within a GLocator, it identifies a finer position.

GLocator::sourceLength

ref Int GLocator::sourceLength

Specifies the length of the sequence of characters, starting at sourceOffset, defined by the GLocator.

GLocator::sourceOffset

ref Int GLocator::sourceOffset

Specifies the position of the first character of the sequence of sourceLength characters defined by the GLocator.

GLocator::sourceSubItemId

ref Int GLocator::sourceSubItemId

Within a GLocator, it identifies a finer position.

LocDecoString::sourcePosition

ref GLocator LocDecoString::sourcePosition

Position of the value within the source texts.

LocDecoString::text

ref DecoString LocDecoString::text

Value associated to this object.

LocInt::sourcePosition

ref GLocator LocInt::sourcePosition

Position of the value within the source texts.

LocInt::value

ref Int LocInt::value

Value associated to this object.

LocNumeric::sourcePosition

ref GLocator LocNumeric::sourcePosition

Position of the value within the source texts.

LocNumeric::value

ref Numeric LocNumeric::value

Value associated to this object.

LocString::sourcePosition

ref GLocator LocString::sourcePosition

Position of the value within the source texts.

LocString::text

ref String LocString::text

Value associated to this object.

StreamableString::text

ref String StreamableString::text

String on which the text is streamed when using the << operator.

System::msg

ref ActiveText System::msg

Object connected to the output window. Text streamed on the "msg" object is printed on the Macrocoder output window.

system().msg << "Hello world" << endl;

TextStream::stream

ref link of IStreamOutText TextStream::stream

Binary stream associated to the TextStream wrapper object..