Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
mozSqlResultEnumerator Class Reference

#include <mozSqlResult.h>

Inheritance diagram for mozSqlResultEnumerator:
Inheritance graph
[legend]
Collaboration diagram for mozSqlResultEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mozSqlResultEnumerator (mozSqlResult *aResult)
virtual ~mozSqlResultEnumerator ()
boolean next ()
 Moves the row pointer to the next row in the results.
boolean previous ()
 Moves the row pointer to the previous row in the results.
void beforeFirst ()
 Moves the row pointer to just before the first row.
void first ()
 Moves the row pointer to the first row.
void last ()
 Moves the row pointer to the last row.
void relative (in long aRows)
 Moves the row pointer by a number relative to the current row.
void absolute (in long aRowIndex)
 Moves the row pointer to a specific row.
boolean isNull (in long aColumnIndex)
 Returns true if the value at the specified column in the current row is null.
nsIVariant getVariant (in long aColumnIndex)
 Returns the value at the specified column in the current row as a variant.
AString getString (in long aColumnIndex)
 Returns the value at the specified column in the current row as a string.
long getInt (in long aColumnIndex)
 Returns the value at the specified column in the current row as an integer.
float getFloat (in long aColumnIndex)
 Returns the value at the specified column in the current row as a float.
float getDecimal (in long aColumnIndex)
 Returns the value at the specified column in the current row as a decimal.
long long getDate (in long aColumnIndex)
 Returns the value at the specified column in the current row as a date.
boolean getBool (in long aColumnIndex)
 Returns the value at the specified column in the current row as a boolean.
void setNull (in long aColumnIndex)
 Sets the value at the specified column in the current row to null.
void setDefault (in long aColumnIndex)
 Sets the value at the specified column in the current row to the default value for that column.
void copy (in long aColumnIndex)
 Sets the value at the specified column in the current row to its original value.
void setVariant (in long aColumnIndex, in nsIVariant aValue)
 Sets the value at the specified column in the current row to a variant.
void setString (in long aColumnIndex, in AString aValue)
 Sets the value at the specified column in the current row to a string.
void setInt (in long aColumnIndex, in long aValue)
 Sets the value at the specified column in the current row to an integer.
void setFloat (in long aColumnIndex, in float aValue)
 Sets the value at the specified column in the current row to a float.
void setDecimal (in long aColumnIndex, in float aValue)
 Sets the value at the specified column in the current row to a decimal.
void setDate (in long aColumnIndex, in long long aValue)
 Sets the value at the specified column in the current row to a date.
void setBool (in long aColumnIndex, in boolean aValue)
 Sets the value at the specified column in the current row to a boolean.
void setNullValues ()
 Sets the value of the cells in all columns in the current row to null.
void setDefaultValues ()
 Sets the value of the cells in all columns in the current row to the default values for the columns.
void copyValues ()
 Sets the values of all of the cells in the current row to their original values.
boolean canInsert ()
 Returns true if inserts are allowed.
boolean canUpdate ()
 Returns true if updates are allowed.
boolean canDelete ()
 Returns true if deletes are allowed.
long insertRow ()
 Inserts a row using the data assigned using the various setX methods.
long updateRow ()
 Updates the current row using the data assigned using the various setX methods.
long deleteRow ()
 Deletes the current row.
boolean hasMoreElements ()
 Called to determine whether or not the enumerator has any elements that can be returned via getNext().
nsISupports getNext ()
 Called to retrieve the next element in the enumerator.

Public Attributes

readonly attribute AString errorMessage
 The most recent error message.
readonly attribute AString currentCondition
 Holds the SQL condition clause.

Private Attributes

mozSqlResultmResult
PRInt32 mCurrentIndex
RowmCurrentRow
RowmBuffer

Detailed Description

Definition at line 390 of file mozSqlResult.h.


Constructor & Destructor Documentation

Definition at line 1532 of file mozSqlResult.cpp.

Here is the call graph for this function:

Definition at line 1542 of file mozSqlResult.cpp.

Here is the call graph for this function:


Member Function Documentation

void mozISqlResultEnumerator::absolute ( in long  aRowIndex) [inherited]

Moves the row pointer to a specific row.

An error occurs if the index is after the last row.

Parameters:
aRowIndexthe index of the row to move to

Moves the row pointer to just before the first row.

Returns true if deletes are allowed.

Returns:
true if deletes are allowed

Returns true if inserts are allowed.

Returns:
true if inserts are allowed

Returns true if updates are allowed.

Returns:
true if updates are allowed
void mozISqlResultEnumerator::copy ( in long  aColumnIndex) [inherited]

Sets the value at the specified column in the current row to its original value.

The row may be changed with the various setX methods and then commited with updateRow.

Parameters:
aColumnIndexthe column to modify

Sets the values of all of the cells in the current row to their original values.

The row may be changed with the various set methods and then commited with updateRow. This method is equivalent to calling the copy method for each column.

Deletes the current row.

Returns:
1 if the row was deleted or -1 if an error occured.

Moves the row pointer to the first row.

boolean mozISqlResultEnumerator::getBool ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a boolean.

An error occurs if the value is not a boolean type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the boolean value
long long mozISqlResultEnumerator::getDate ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a date.

An error occurs if the value is not a date type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the date value
float mozISqlResultEnumerator::getDecimal ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a decimal.

An error occurs if the value is not a decimal type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the decimal value
float mozISqlResultEnumerator::getFloat ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a float.

An error occurs if the value is not a float type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the float value
long mozISqlResultEnumerator::getInt ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as an integer.

An error occurs if the value is not a integer type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the integer value
nsISupports nsISimpleEnumerator::getNext ( ) [inherited]

Called to retrieve the next element in the enumerator.

The "next" element is the first element upon the first call. Must be pre-ceeded by a call to hasMoreElements() which returns PR_TRUE. This method is generally called within a loop to iterate over the elements in the enumerator.

See also:
hasMoreElements()
Returns:
NS_OK if the call succeeded in returning a non-null value through the out parameter. NS_ERROR_FAILURE if there are no more elements to enumerate.
the next element in the enumeration.

Here is the caller graph for this function:

AString mozISqlResultEnumerator::getString ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a string.

An error occurs if the value is not a string type.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the string value
nsIVariant mozISqlResultEnumerator::getVariant ( in long  aColumnIndex) [inherited]

Returns the value at the specified column in the current row as a variant.

Parameters:
aColumnIndexthe column to retrieve
Returns:
the value as a variant

Called to determine whether or not the enumerator has any elements that can be returned via getNext().

This method is generally used to determine whether or not to initiate or continue iteration over the enumerator, though it can be called without subsequent getNext() calls. Does not affect internal state of enumerator.

See also:
getNext()
Returns:
PR_TRUE if there are remaining elements in the enumerator. PR_FALSE if there are no more elements in the enumerator.

Here is the caller graph for this function:

Inserts a row using the data assigned using the various setX methods.

The row was inserted successfully if 0 or 1 is returned, however if 0 is returned, the row does not satisfy the where condition of the result (that is, it doesn't belong in the result enumerator) and does not need to be displayed.

Returns:
1 if the row was inserted, 0 if the row was inserted but does not fit the condition, or -1 if an error occured.
boolean mozISqlResultEnumerator::isNull ( in long  aColumnIndex) [inherited]

Returns true if the value at the specified column in the current row is null.

Parameters:
aColumnIndexthe column to retrieve
Returns:
true if the value is null

Moves the row pointer to the last row.

Moves the row pointer to the next row in the results.

Returns true if there is a next row and false if there are no more rows.

Returns:
false if there are no more rows

Moves the row pointer to the previous row in the results.

Returns true if there is a previous row.

Returns:
false if there are no previous rows

Moves the row pointer by a number relative to the current row.

An error occurs if this causes the row pointer to extend past the last row. This method may also be used to move the row pointer back by using a negative value.

Parameters:
aRowIndexaRowIndex the number of rows to move by
void mozISqlResultEnumerator::setBool ( in long  aColumnIndex,
in boolean  aValue 
) [inherited]

Sets the value at the specified column in the current row to a boolean.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setDate ( in long  aColumnIndex,
in long long  aValue 
) [inherited]

Sets the value at the specified column in the current row to a date.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setDecimal ( in long  aColumnIndex,
in float  aValue 
) [inherited]

Sets the value at the specified column in the current row to a decimal.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setDefault ( in long  aColumnIndex) [inherited]

Sets the value at the specified column in the current row to the default value for that column.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify

Sets the value of the cells in all columns in the current row to the default values for the columns.

This is equivalent to calling setDefaultValue for every column.

void mozISqlResultEnumerator::setFloat ( in long  aColumnIndex,
in float  aValue 
) [inherited]

Sets the value at the specified column in the current row to a float.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setInt ( in long  aColumnIndex,
in long  aValue 
) [inherited]

Sets the value at the specified column in the current row to an integer.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setNull ( in long  aColumnIndex) [inherited]

Sets the value at the specified column in the current row to null.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify

Sets the value of the cells in all columns in the current row to null.

This is equivalent to calling setNullValue for every column.

void mozISqlResultEnumerator::setString ( in long  aColumnIndex,
in AString  aValue 
) [inherited]

Sets the value at the specified column in the current row to a string.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign
void mozISqlResultEnumerator::setVariant ( in long  aColumnIndex,
in nsIVariant  aValue 
) [inherited]

Sets the value at the specified column in the current row to a variant.

Changes are not committed until either the insertRow or updateRow method is called.

Parameters:
aColumnIndexthe column to modify
aValuethe value to assign

Updates the current row using the data assigned using the various setX methods.

The row was inserted successfully if 0 or 1 is returned, however if 0 is returned, the row does not satisfy the where condition of the result and does not need to be displayed.

Returns:
1 if the row was updated, 0 if the row was updated but does not fit the condition, or -1 if an error occured.

Member Data Documentation

Holds the SQL condition clause.

Definition at line 361 of file mozISqlResultEnumerator.idl.

readonly attribute AString mozISqlResultEnumerator::errorMessage [inherited]

The most recent error message.

Definition at line 60 of file mozISqlResultEnumerator.idl.

Definition at line 407 of file mozSqlResult.h.

Definition at line 405 of file mozSqlResult.h.

Definition at line 406 of file mozSqlResult.h.

Definition at line 404 of file mozSqlResult.h.


The documentation for this class was generated from the following files: