EPOC   SDK Home Glossary Indexes Previous Next Up

CCommDbOverrideSettings class


Contents


CCommDbOverrideSettings class — Override settings

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

CBase

Abstract: CBase behavior

CCommDbOverrideSettings

Override settings

Defined in

cdbover.h

Link against

commdb.lib

Description

Use an object of this type as a repository of override settings for columns in tables.


Allocation and construction


NewL() — Create an override settings object

static CCommDbOverrideSettings* NewL(TParamList aParamList);

Description

Use this static function to allocate and construct an override settings object.

The construction process automatically opens the communications database and connects to the DBMS. The database is closed and the connection to the DBMS is severed when this override object is destroyed.

Arguments

TParamList aParamList

An enumerator which declares whether the new override settings object is to be full or partial.

Return Value

CCommDbOverrideSettings*

A pointer to the new override settings object.


Destruction


~CCommDbOverrideSettings() — Destructor

~CCommDbOverrideSettings();

Description

The destructor frees all resources owned by this object, prior to its destruction.

Specifically, it closes the communications database and severs the connection with the DBMS.


Setting override values


SetIntOverride() — Set override value for an unsigned integer type column

TInt SetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32 aValue);

Description

Use this function to set an override value for the column whose name is supplied in the descriptor aColumnName in the table whose name is given in descriptor aTableName.

If the column name is empty, i.e. the length of the descriptor aColumnName is zero, then the override value is assumed to be the overriding Id for the default record for table aTableName. This means that the table must be one which supports default records.

For the function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

If this descriptor is empty, i.e. its length is zero, then aValue is assumed to be the overriding Id for the default record.

TUint32 aValue

The override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotSupported is returned if the table does not support override settings. Support is restricted to:

  • the dial-out service table, with symbolic name DIAL_OUT_SERVICE
  • the dial-in service table, with symbolic name DIAL_IN_SERVICE
  • the location table, with symbolic name LOCATION
  • the chargecard table, with symbolic name CHARGECARD

KErrNotFound if:

  • the column cannot be found

or

  • the column type is not an unsigned integer

or

  • the override is for the Id of the default record and default records are not suppported for this table.

KErrAlreadyExists if an override already exists.


SetBoolOverride() — Set override value for a boolean type column

TInt SetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool aValue);

Description

Use this function to set an override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For the function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TBool aValue

The override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotSupported is returned if the table does not support override values. Support is restricted to:

  • the dial-out service table, with symbolic name DIAL_OUT_SERVICE
  • the dial-in service table, with symbolic name DIAL_IN_SERVICE
  • the location table, with symbolic name LOCATION
  • the chargecard table, with symbolic name CHARGECARD

KErrNotFound if the column cannot be found.

KErrAlreadyExists if an override for this column in this table already exists.


SetDesOverride() — Set override value for a narrow text type column

TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC8& aValue);

Description

Use this function to set an override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For the function to succeed:

In addition, the maximum length of text expected by this function is the value of the constant KCommsDbSvrMaxFieldLength defined in cdblen.h. The length of aValue supplied by the caller cannot be greater than this value.

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

const TDesC8& aValue

The override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotSupported is returned if the table does not support override values. Support is restricted to:

  • the dial-out service table, with symbolic name DIAL_OUT_SERVICE
  • the dial-in service table, with symbolic name DIAL_IN_SERVICE
  • the location table, with symbolic name LOCATION
  • the chargecard table, with symbolic name CHARGECARD

KErrNotFound if the column cannot be found.

KErrAlreadyExists if an override for this column in this table already exists.

KErrOverflow if the length of aValue is greater than KCommsDbSvrMaxFieldLength


SetDesOverride() — Set override value for a wide text type column

TInt SetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC16& aValue);

Description

Use this function to set an override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For the function to succeed:

In addition, the maximum length of text expected by this function is the value of the constant KCommsDbSvrMaxFieldLength defined in cdblen.h. The length of aValue supplied by the caller cannot be greater than this value.

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

const TDesC16& aValue

The override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotSupported is returned if the table does not support override values. Support is restricted to:

  • the dial-out service table, with symbolic name DIAL_OUT_SERVICE
  • the dial-in service table, with symbolic name DIAL_IN_SERVICE
  • the location table, with symbolic name LOCATION
  • the chargecard table, with symbolic name CHARGECARD

KErrNotFound if the column cannot be found.

KErrAlreadyExists if an override for this column in this table already exists.

KErrOverflow if the length of aValue is greater than KCommsDbSvrMaxFieldLength


SetLongDesOverride() — Set override value for a long text type column

TInt SetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, const TDesC& aValue);

Description

Use this function to set an override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For the function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

const TDesC& aValue

The override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotSupported is returned if the table does not support override values. Support is restricted to:

  • the dial-out service table, with symbolic name DIAL_OUT_SERVICE
  • the dial-in service table, with symbolic name DIAL_IN_SERVICE
  • the location table, with symbolic name LOCATION
  • the chargecard table, with symbolic name CHARGECARD

KErrNotFound if the column cannot be found.

KErrAlreadyExists if an override for this column in this table already exists.


Getting override values


GetIntOverride() — Fetch the override value for an unsigned integer type column

TInt GetIntOverride(const TDesC& aTableName, const TDesC& aColumnName, TUint32& aValue);

Description

Use this function to fetch the override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

If the column name is empty, i.e. the length of the descriptor aColumnName is zero, then the override value is assumed to be the overriding Id for the default record for table aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TUint32& aValue

An unsigned integer type passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings

GetBoolOverride() — Fetch the override value for a boolean type column

TInt GetBoolOverride(const TDesC& aTableName, const TDesC& aColumnName, TBool& aValue);

Description

Use this function to fetch the override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TBool& aValue

A boolean type passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings

GetDesOverride() — Fetch the override value for a narrow text type column

TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes8& aValue);

Description

Use this function to fetch the override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TDes8& aValue

An 8 bit type descriptor passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings

GetDesOverride() — Fetch the override value for a wide text type column

TInt GetDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes16& aValue);

Description

Use this function to fetch the override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TDes16& aValue

A 16 bit type descriptor passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings

GetLongDesOverrideLength() — Fetch the length of the override value for a long text type column

TInt GetLongDesOverrideLength(const TDesC& aTableName, const TDesC& aColumnName, TInt& aLength);

Description

Use this function to fetch the length of the long text override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TInt& aLength

A signed integer type passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings

GetLongDesOverride() — Fetch the override value for a long text type column

TInt GetLongDesOverride(const TDesC& aTableName, const TDesC& aColumnName, TDes& aValue);

Description

Use this function to fetch the override value for the column whose name is supplied in descriptor aColumnName in the table whose name is given in descriptor aTableName.

For this function to succeed:

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumn

A reference to a descriptor containing the name of a column in table aTableName.

TDes& aValue

A descriptor passed by the caller. On successful return from this function, it contains the override value.

Return Value

TInt

KErrNone if successful, otherwise one of the system error codes.

Specifically:

KErrNotFound if:

  • there is no override value for the specified table and column.
  • the table does not support override settings
Notes

The maximum length of the descriptor aValue must be large enough to contain the override text. Use the GetLongDesOverrideLength() function to find the length of this text.


Information


IsOverridden() — Determine whether override value exists

TBool IsOverridden(const TDesC& aTableName, const TDesC& aColumnName, TValueType aType);

Description

Use this function to determine whether an override value of type aType exists for the column whose name is supplied in descriptor aColumnName in the table whose name is given in the descriptor aTableName.

Arguments

const TDesC& aTableName

A reference to a descriptor containing the name of a table in the communications database.

const TDesC& aColumnName

A reference to a descriptor containing the name of a column in table aTableName which is to be overridden.

TValueType aType

An enumeration which indicates the type of data in column aType which is to be overridden.

Return Value

TBool

true if the value is overridden,

false otherwise.


PartialFull() — Determine whether override list is full or partial

TParamList PartialFull() const;

Description

Use this function to determine whether the override list is full or partial.

Return Value

TParamList

An enumeration which determines whether this set of override values is full or partial.


Enumerations


TParamList enum — Full/partial override settings

EParamListPartial

The override settings are partial; the CCommDbOverrideSettings object maintains override values for only some of the columns.

EParamListFull

The override settings are full; the CCommDbOverrideSettings object maintains override values for all columns

EPOC       SDK Home Glossary Indexes Previous Next Up