rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliStringsTable Class Reference

Table class. More...

#include <ilviews/dataccess/strtable.h>

Inheritance diagram for IliStringsTable:
IliTable IliSchema IliRefCounted

List of all members.

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.

Detailed Description

Table class.

Library: dataccess

The IliStringsTable class defines tables that only have one column of type IliStringType.


Constructor & Destructor Documentation

IliStringsTable::IliStringsTable ( IlvDisplay display  ) 

This constructor initializes an empty strings table.

Parameters:
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.

Parameters:
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.

Parameters:
input The input stream.

Member Function Documentation

virtual IlBoolean IliStringsTable::allowRowMove (  )  const [virtual]

Returns IlTrue if the table (or subclass of the table) allows row move operations.

Returns:
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.

Parameters:
str The string.
Returns:
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.

virtual IlBoolean IliStringsTable::deleteRow ( IlInt  rowno  )  [virtual]

Deletes a row.

Parameters:
rowno The row position.
Returns:
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.

IlBoolean IliStringsTable::deleteString ( IlInt  pos  ) 

Deletes a row.

Parameters:
rowno The insertion position.
Returns:
IlTrue if successful.
virtual IlInt IliStringsTable::getRowsCount (  )  const [virtual]

Returns the number of rows in the table.

Returns:
The count.

Reimplemented from IliTable.

const char* IliStringsTable::getString ( IlInt   ) 

Returns the character string in the row.

Parameters:
pos The row position.
Returns:
The character string or NULL if the position is out of bounds.
IlInt IliStringsTable::getStringIndex ( const char *  ,
IlInt  from = 0 
)

Returns the position of the first row which has a value equal to a value.

Returns:
The position of the first row which has a value equal to 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.

Parameters:
count The string count.
Returns:
The rows of the string table in the form of an array of character strings. Note that the return value remains valid only as long as the string table does not change.
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.

Parameters:
rowno The row position.
colno The column position.
value The value.
Returns:
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.

Parameters:
rowno The row position.
buff The table buffer.
Returns:
IlTrue if successful, and IlFalse if rowno is out of bounds, or if the row could not be inserted.

Reimplemented from IliTable.

IlBoolean IliStringsTable::insertString ( IlInt  rowno,
const char *  str 
)

Inserts a new row.

Parameters:
rowno The insertion position.
str The string.
Returns:
IlTrue if successful.
void IliStringsTable::insertTable ( IliTable tbl,
IlInt  colno = 0,
IlInt  rowno = -1 
)

Inserts new rows.

Parameters:
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.
virtual IlBoolean IliStringsTable::moveRow ( IlInt  from,
IlInt  to 
) [virtual]

Moves a row.

Parameters:
from The origin row position.
to The destination row position.
Returns:
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.

IlBoolean IliStringsTable::setString ( IlInt  rowno,
const char *  str 
)

Sets the string in a row.

Parameters:
rowno The row position.
str The string.
Returns:
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.

Parameters:
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.

Parameters:
rowno The row position.
buff The table buffer.
Returns:
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.

Parameters:
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.