Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Table class. More...
#include <ilviews/dataccess/strtable.h>
Public Member Functions | |
IliStringsTable (IlvDisplay *, IL_STDPREF istream &input) | |
This constructor initializes a string table by reading its definition from a stream. | |
IliStringsTable (const IliStringsTable &) | |
This is the copy constructor of class IliStringsTable . | |
IliStringsTable (IlvDisplay *display, const char *const *strings, IlInt count, IlBoolean copy=IlTrue) | |
This constructor initializes a strings table with a list of rows. | |
IliStringsTable (IlvDisplay *display) | |
This constructor initializes an empty strings table. | |
virtual IlBoolean | allowRowMove () const |
Returns IlTrue if the table (or subclass of the table) allows row move operations. | |
IlBoolean | appendString (const char *str) |
Appends a new row at the end of the table. | |
virtual void | clearRows () |
Deletes all rows. | |
virtual IlBoolean | deleteRow (IlInt) |
Deletes a row. | |
IlBoolean | deleteString (IlInt pos) |
Deletes a row. | |
virtual IlInt | getRowsCount () const |
Returns the number of rows in the table. | |
const char * | getString (IlInt) |
Returns the character string in the row. | |
IlInt | getStringIndex (const char *, IlInt from=0) |
Returns the position of the first row which has a value equal to a value. | |
const char *const * | getStrings (IlInt &count) |
Returns the rows of the string table in the form of an array of character strings. | |
virtual IlBoolean | getValue (IlInt rowno, IlInt colno, IliValue &val) const |
Returns a value. | |
virtual IlBoolean | insertRow (IlInt, IliTableBuffer *) |
Inserts a row that is defined by the table buffer. | |
IlBoolean | insertString (IlInt rowno, const char *str) |
Inserts a new row. | |
void | insertTable (IliTable *tbl, IlInt colno=0, IlInt rowno=-1) |
Inserts new rows. | |
virtual IlBoolean | moveRow (IlInt, IlInt) |
Moves a row. | |
IlBoolean | setString (IlInt rowno, const char *str) |
Sets the string in a row. | |
void | setStrings (const char *const *strings, IlInt count, IlBoolean copy=IlTrue) |
Changes the contents of the string table. | |
virtual IlBoolean | updateRow (IlInt, IliTableBuffer *) |
Updates a row with the values in the table buffer. | |
virtual void | write (IL_STDPREF ostream &output) const |
Writes the definition of the string table to an output stream in a form suitable for reading back with the stream-based constructor. |
Table class.
Library: dataccess
The IliStringsTable
class defines tables that only have one column of type IliStringType
.
IliStringsTable::IliStringsTable | ( | IlvDisplay * | display | ) |
This constructor initializes an empty strings table.
display | The display. |
IliStringsTable::IliStringsTable | ( | IlvDisplay * | display, | |
const char *const * | strings, | |||
IlInt | count, | |||
IlBoolean | copy = IlTrue | |||
) |
This constructor initializes a strings table with a list of rows.
display | The display. | |
strings | The list of strings. | |
count | The string count. | |
copy | If IlTrue , this constructor will copy both the array and the character strings it contains. Otherwise, it will keep pointers to these values. Note that if copy is IlFalse , it is assumed that the strings array and the character strings it contains, have been allocated with the standard new operator, and that the IliStringsTable object becomes their owner. |
IliStringsTable::IliStringsTable | ( | IlvDisplay * | , | |
IL_STDPREF istream & | input | |||
) |
This constructor initializes a string table by reading its definition from a stream.
input | The input stream. |
virtual IlBoolean IliStringsTable::allowRowMove | ( | ) | const [virtual] |
Returns IlTrue
if the table (or subclass of the table) allows row move operations.
IlTrue
if the table (or subclass of the table) allows row move operations. Reimplemented from IliTable.
IlBoolean IliStringsTable::appendString | ( | const char * | str | ) |
Appends a new row at the end of the table.
str | The string. |
IlTrue
if successful. virtual void IliStringsTable::clearRows | ( | ) | [virtual] |
Deletes all rows.
If the table (or subclass of the table) defines a mapping with a remote database, then only the rows in the IliTable
object are deleted. The rows in the remote database are not affected by this operation. This enables the row cache of such a table to be cleared.
Reimplemented from IliTable.
Deletes a row.
rowno | The row position. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be deleted. If the table (or subclass of the table) defines a mapping with a remote database, the row is also deleted in the remote database. Reimplemented from IliTable.
Deletes a row.
rowno | The insertion position. |
IlTrue
if successful. virtual IlInt IliStringsTable::getRowsCount | ( | ) | const [virtual] |
const char* IliStringsTable::getString | ( | IlInt | ) |
Returns the character string in the row.
pos | The row position. |
NULL
if the position is out of bounds. Returns the position of the first row which has a value equal to a value.
str
. The search starts at row from
. This member function returns -1
if no such row is found. const char* const* IliStringsTable::getStrings | ( | IlInt & | count | ) |
Returns the rows of the string table in the form of an array of character strings.
count | The string count. |
virtual IlBoolean IliStringsTable::getValue | ( | IlInt | rowno, | |
IlInt | colno, | |||
IliValue & | value | |||
) | const [virtual] |
Returns a value.
This member function handles the fetching of the row (and all preceding rows) as necessary.
rowno | The row position. | |
colno | The column position. | |
value | The value. |
IlTrue
if successful. Reimplemented from IliTable.
virtual IlBoolean IliStringsTable::insertRow | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Inserts a row that is defined by the table buffer.
Not all the values are used to insert the row, instead the values for which the isModified
are used, the others being replaced by null values. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also inserted in the remote database.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful, and IlFalse
if rowno
is out of bounds, or if the row could not be inserted. Reimplemented from IliTable.
Inserts a new row.
rowno | The insertion position. | |
str | The string. |
IlTrue
if successful. Inserts new rows.
tbl | The table which contains the rows. | |
colno | The column position in the table. The format of the column is used to convert values into character strings. | |
rowno | The insertion position. If -1 , the rows are inserted at the end. |
Moves a row.
from | The origin row position. | |
to | The destination row position. |
IlTrue
if successful. If the table (or subclass of the table) defines a mapping with a remote database, the row is also moved in the remote database (if possible). Reimplemented from IliTable.
Sets the string in a row.
rowno | The row position. | |
str | The string. |
IlTrue
if successful. void IliStringsTable::setStrings | ( | const char *const * | strings, | |
IlInt | count, | |||
IlBoolean | copy = IlTrue | |||
) |
Changes the contents of the string table.
All previous rows are deleted and are replaced by the character strings in the array.
strings | The list of strings. | |
count | The string count. | |
copy | If IlTrue , this constructor will copy both the array and the character strings it contains. Otherwise, it will keep pointers to these values. Note that if copy is IlFalse , it is assumed that the strings array and the character strings it contains, have been allocated with the standard new operator, and that the IliStringsTable object becomes their owner. |
virtual IlBoolean IliStringsTable::updateRow | ( | IlInt | rowno, | |
IliTableBuffer * | buff | |||
) | [virtual] |
Updates a row with the values in the table buffer.
Not all the values are used to update the row. Instead the values for which the isModified
member function returns IlTrue
, are used. Note that this member function does not check any of the constraints defined in the schema. If the table (or subclass of the table) defines a mapping with a remote database, the row is also changed in the remote database.
rowno | The row position. | |
buff | The table buffer. |
IlTrue
if successful and IlFalse
if rowno
is out of bounds, or if the row could not be updated. Reimplemented from IliTable.
virtual void IliStringsTable::write | ( | IL_STDPREF ostream & | output | ) | const [virtual] |
Writes the definition of the string table to an output stream in a form suitable for reading back with the stream-based constructor.
output | The output stream. |
Reimplemented from IliTable.
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.