diff -r ebc84c812384 -r 46218c8b8afa Symbian3/PDK/Source/GUID-5872329F-2B52-5F52-83C1-205F2F933877.dita --- a/Symbian3/PDK/Source/GUID-5872329F-2B52-5F52-83C1-205F2F933877.dita Thu Mar 11 15:24:26 2010 +0000 +++ b/Symbian3/PDK/Source/GUID-5872329F-2B52-5F52-83C1-205F2F933877.dita Thu Mar 11 18:02:22 2010 +0000 @@ -1,48 +1,48 @@ - - - - - -OR_LEAVE -macro TutorialMacro is a rule or pattern that specifies how a certain input sequence -should be mapped to an output sequence according to a defined procedure. This -tutorial describes the OR_LEAVE macro and provides details on how the OR_LEAVE -macro should be used. -
Required background

Before beginning you must know -the following:

    -
  • UserLeaveIfError() : Error -handling code. This function is called when a client is passing a file for -a server to handle.

  • -
-
Introduction

The OR_LEAVE macro is a convenience -macro that allows the developer to deemphasize auxiliary error checking code -in most cases. It is a postfix macro which implements User::LeaveIfError() on -an integer return type. This means that there is less focus on the error handling -code and makes the code easier to read.

Defining a OR_LEAVE macro

The -OR_LEAVE macro is defined as a postfix operator. An example code snippet is -shown below:

-#define OR_LEAVE || Eleave -inline void operator||(Tint aStatus, Tleave /*aTag*/) - { - User::LeaveIfError(aStatus); - } -

It is a postfix macro which implements User::LeaveIfError() function -on an integer return type. This means that there is less focus on the error -handling code and makes the code easier to read.

-
Using OR_LEAVE macro

The OR_LEAVE -is used to replace a call to User::LeaveIfError() function. -An example code snippet is shown below:

User::LeaveIfError(iTimer->CreateLocal());

The -call to iTimer->CreateLocal() is included within the error -handling code User::LeaveIfError() function and is difficult -to read. The following fragment uses the OR_LEAVE macro.

iTimer->CreateLocal() OR_LEAVE; -
-
-EUser High -Level Library Overview + + + + + +OR_LEAVE +macro TutorialMacro is a rule or pattern that specifies how a certain input sequence +should be mapped to an output sequence according to a defined procedure. This +tutorial describes the OR_LEAVE macro and provides details on how the OR_LEAVE +macro should be used. +
Required background

Before beginning you must know +the following:

    +
  • UserLeaveIfError() : Error +handling code. This function is called when a client is passing a file for +a server to handle.

  • +
+
Introduction

The OR_LEAVE macro is a convenience +macro that allows the developer to deemphasize auxiliary error checking code +in most cases. It is a postfix macro which implements User::LeaveIfError() on +an integer return type. This means that there is less focus on the error handling +code and makes the code easier to read.

Defining a OR_LEAVE macro

The +OR_LEAVE macro is defined as a postfix operator. An example code snippet is +shown below:

+#define OR_LEAVE || Eleave +inline void operator||(Tint aStatus, Tleave /*aTag*/) + { + User::LeaveIfError(aStatus); + } +

It is a postfix macro which implements User::LeaveIfError() function +on an integer return type. This means that there is less focus on the error +handling code and makes the code easier to read.

+
Using OR_LEAVE macro

The OR_LEAVE +is used to replace a call to User::LeaveIfError() function. +An example code snippet is shown below:

User::LeaveIfError(iTimer->CreateLocal());

The +call to iTimer->CreateLocal() is included within the error +handling code User::LeaveIfError() function and is difficult +to read. The following fragment uses the OR_LEAVE macro.

iTimer->CreateLocal() OR_LEAVE; +
+
+EUser High +Level Library Overview
\ No newline at end of file