Scol standard library package
0.3.1
Common and usefull functions for all Scol applications
|
Functions | |
std_itAdd (oIt, szToAdd) | |
Add the substring to a StdIteration object from the current cursor position. The cursor position keeps unchanged. More... | |
std_itGepIncluded (oIt) | |
Get if the current defined seperator is included (or not in the return. More... | |
std_itGet (oIt) | |
Return the initial object. More... | |
std_itGetLastLength (oIt) | |
Get the last given length for read. More... | |
std_itGetLength (oIt) | |
Get the length of a StdIteration object. More... | |
std_itGetPos (oIt) | |
Get the current cursor position of a StdIteration object. More... | |
std_itGetPosBegin (oIt) | |
Get the minimum cursor position. More... | |
std_itGetPosEnd (oIt) | |
Get the maximum cursor position. More... | |
std_itGetSep (oIt) | |
Get the current defined seperator. More... | |
std_itNewFile (chn, pFile) | |
Create a new StdIteration object from a File object. More... | |
std_itNewS (szValue) | |
Create a new StdIteration object from a string. More... | |
std_itNewTab (tab) | |
Create a new StdIteration object from a tab (array) object. More... | |
std_itRead (oIt, iLength) | |
Read the subcontent of a StdIteration object from the current cursor position and the given lenght (like the fread C-function). Next, the position will be updated (current position + lenght) More... | |
std_itReadNext (oIt) | |
Read the subcontent of a StdIteration object from the current cursor position to one unit (byte, char or other) (like the fread C-function). Next, the position will be updated (current position + 1) More... | |
std_itReadSep (oIt) | |
Read the subcontent of a StdIteration object from the current cursor position until the next separator found. More... | |
std_itSepIncluded (oIt, iFlag) | |
Set if the separator is included in the return or not. More... | |
std_itSetCb (oIt, cbfun) | |
Set the function called for each iteration. More... | |
std_itSetCbEnd (oIt, cbfun) | |
Set the function called when the ioterator comes to the end. More... | |
std_itSetPosBegin (oIt, iPosBegin) | |
Set the minimum cursor position. By default it is 0. More... | |
std_itSetPosEnd (oIt, iPosEnd) | |
Set themaximum cursor position. By default it is the lenght of the object. More... | |
std_itSetSep (oIt, iSep) | |
Define a separator for a StdIteration object. More... | |
std_itSetSepFromS (oIt, szSep) | |
Define a separator for a StdIteration object. More... | |
std_itUpdatePos (oIt, iPos, iFlag) | |
Read the subcontent of a StdIteration tab (array) object from the current cursor position and the given lenght (like the fread C-function). Next, the position will be updated (current position + lenght) More... | |
Package to load : lib/std/iteration.pkg
Dependancies :
std_itNewS | ( | szValue | ) |
Create a new StdIteration object from a string.
Prototype : fun [S] StdIteration
The current cursor position is put at 0.
S | : an inital string to iterate |
std_itNewFile | ( | chn | , |
pFile | |||
) |
Create a new StdIteration object from a File object.
Prototype : fun [Chn P] StdIteration
The current cursor position is put at 0.
Chn | : a channel, like the current channel (_channel) |
P | : a read file reference to iterate |
std_itNewTab | ( | tab | ) |
Create a new StdIteration object from a tab (array) object.
Prototype : fun [tab u0] StdIteration
The current cursor position is put at 0.
tab | u0 : a table (array) to iterate |
std_itRead | ( | oIt | , |
iLength | |||
) |
Read the subcontent of a StdIteration object from the current cursor position and the given lenght (like the fread C-function). Next, the position will be updated (current position + lenght)
Prototype : fun [StdIteration I] S
StdIteration | : a StdIteration object to iterate |
I | : a lenght (can be a negative or positive integer) |
std_itReadNext | ( | oIt | ) |
Read the subcontent of a StdIteration object from the current cursor position to one unit (byte, char or other) (like the fread C-function). Next, the position will be updated (current position + 1)
Prototype : fun [StdIteration] S
StdIteration | : a StdIteration object to iterate |
std_itUpdatePos | ( | oIt | , |
iPos | , | ||
iFlag | |||
) |
Read the subcontent of a StdIteration tab (array) object from the current cursor position and the given lenght (like the fread C-function). Next, the position will be updated (current position + lenght)
Prototype : fun [StdIteration I] tab u0
StdIteration | : a StdIteration object to iterate |
I | : a lenght (can be a negative or positive integer) |
Update the cursor position.
Prototype : fun [StdIteration I I] StdIteration
StdIteration | : a StdIteration object to iterate |
I | : a new position (if negative, the new position will be 0, if too long, the new position will be truncated. |
I | : a flag :
|
std_itSetPosBegin | ( | oIt | , |
iPosBegin | |||
) |
Set the minimum cursor position. By default it is 0.
Prototype : fun [StdIteration I] StdIteration
StdIteration | : a StdIteration object to iterate |
I | : a new minimum position (can be negative, the new position will be from the maximum). |
std_itSetPosEnd | ( | oIt | , |
iPosEnd | |||
) |
Set themaximum cursor position. By default it is the lenght of the object.
Prototype : fun [StdIteration I I] StdIteration
StdIteration | : a StdIteration object to iterate |
I | : a new maximum position (can be negative, the new position will be from the old maximum). |
std_itGetPosBegin | ( | oIt | ) |
Get the minimum cursor position.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itGetPosEnd | ( | oIt | ) |
Get the maximum cursor position.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itGetLength | ( | oIt | ) |
Get the length of a StdIteration object.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itGetPos | ( | oIt | ) |
Get the current cursor position of a StdIteration object.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itGetLastLength | ( | oIt | ) |
Get the last given length for read.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itGet | ( | oIt | ) |
Return the initial object.
Prototype : fun [StdIteration] S
StdIteration | : a StdIteration object to iterate |
std_itSetCbEnd | ( | oIt | , |
cbfun | |||
) |
Set the function called when the ioterator comes to the end.
Prototype : fun [StdIteration fun [StdIteration] I] StdIteration
StdIteration | : a StdIteration object to iterate |
fun | [StdIteration] I : the callback (the argument is the StdIteration object itself) |
std_itSetCb | ( | oIt | , |
cbfun | |||
) |
Set the function called for each iteration.
Prototype : fun [StdIteration fun [StdIteration S] I] StdIteration
StdIteration | : a StdIteration object to iterate |
fun | [StdIteration S] I : the callback. The arguments are :
|
std_itAdd | ( | oIt | , |
szToAdd | |||
) |
Add the substring to a StdIteration object from the current cursor position. The cursor position keeps unchanged.
Prototype : fun [StdIteration S] StdIteration
StdIteration | : a StdIteration object to iterate |
S | : a string to add (to include) |
std_itSetSep | ( | oIt | , |
iSep | |||
) |
Define a separator for a StdIteration object.
A separator is an ascii value.
Prototype : fun [StdIteration I] StdIteration
StdIteration | : a StdIteration object to iterate |
I | : an ascii value |
std_itSetSepFromS | ( | oIt | , |
szSep | |||
) |
Define a separator for a StdIteration object.
A separator is an ascii value.
Prototype : fun [StdIteration S] StdIteration
StdIteration | : a StdIteration object to iterate |
S | : a string. The first char will take off only, others are ignored. This function is a convenience to avoid to give the ascii value directly. |
std_itGetSep | ( | oIt | ) |
Get the current defined seperator.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itSepIncluded | ( | oIt | , |
iFlag | |||
) |
Set if the separator is included in the return or not.
Prototype : fun [StdIteration I] StdIteration
StdIteration | : a StdIteration object to iterate |
I | : 1 to include, 0 to not include (default) |
std_itGepIncluded | ( | oIt | ) |
Get if the current defined seperator is included (or not in the return.
Prototype : fun [StdIteration] I
StdIteration | : a StdIteration object to iterate |
std_itReadSep | ( | oIt | ) |
Read the subcontent of a StdIteration object from the current cursor position until the next separator found.
If the separator is not found, th ewhole subcontent from the current sursor position until the end position is returned. Next, the cursor position will be updated.
Prototype : fun [StdIteration] S
StdIteration | : a StdIteration object to iterate |