Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

value.h File Reference

#include <gwenhywfar/db.h>
#include <aqbanking/error.h>

Go to the source code of this file.

Constructor/Destructor

AB_VALUEAB_Value_new (double value, const char *currency)
AB_VALUEAB_Value_dup (const AB_VALUE *v)
AB_VALUEAB_Value_fromString (const char *s)
AB_VALUEAB_Value_fromDb (GWEN_DB_NODE *db)
int AB_Value_toDb (const AB_VALUE *v, GWEN_DB_NODE *db)
void AB_Value_free (AB_VALUE *v)

Getters/Setters

double AB_Value_GetValue (const AB_VALUE *v)
void AB_Value_SetValue (AB_VALUE *v, double d)
const char * AB_Value_GetCurrency (const AB_VALUE *v)
void AB_Value_SetCurrency (AB_VALUE *v, const char *s)

Predicates/Comparisons

int AB_Value_IsValid (const AB_VALUE *v)
int AB_Value_IsNegative (const AB_VALUE *v)
int AB_Value_IsPositive (const AB_VALUE *v)
int AB_Value_IsZero (const AB_VALUE *v)
int AB_Value_IsEqual (const AB_VALUE *v1, const AB_VALUE *v2)
int AB_Value_Compare (const AB_VALUE *v1, const AB_VALUE *v2)

Arithmetic operations

int AB_Value_AddValue (AB_VALUE *v, const AB_VALUE *vToAdd)
int AB_Value_SubValue (AB_VALUE *v, const AB_VALUE *vToSub)
int AB_Value_Negate (AB_VALUE *v)

Typedefs

typedef AB_VALUE AB_VALUE


Typedef Documentation

typedef struct AB_VALUE AB_VALUE
 

An abstract monetary value in HBCI. It has an amount and a currency string.

Right now the amount is stored as a "double" floating-point value, but in the future this might be changed to a fixed-point representation to avoid rounding errors in financial calculations. Therefore some basic arithmetic operations are already supported, and more are likely to come.

Definition at line 32 of file value.h.


Function Documentation

int AB_Value_AddValue AB_VALUE v,
const AB_VALUE vToAdd
 

Add the value vToAdd to the given value , i.e. assign v=v+vToAdd. Returns zero on success, or -1 if any input argument is invalid. (Note: Right now this function ignores the currency field.)

int AB_Value_Compare const AB_VALUE v1,
const AB_VALUE v2
 

Compare function: Returns +1 if v1>v2, zero if v1 == v2, and -1 if v1<v2. (Note: Right now this function ignores the currency field.)

AB_VALUE* AB_Value_dup const AB_VALUE v  ) 
 

Create a duplicate of the given value (Copy constructor).

void AB_Value_free AB_VALUE v  ) 
 

Free the given value (Destructor).

AB_VALUE* AB_Value_fromDb GWEN_DB_NODE *  db  ) 
 

Create a value from the given GWEN_DB.

AB_VALUE* AB_Value_fromString const char *  s  ) 
 

Create a value from the given string. FIXME: describe string format here.

const char* AB_Value_GetCurrency const AB_VALUE v  ) 
 

Returns the ISO-4217 currency string of the given value, e.g. "EUR" for Euro. WATCH OUT: The currency string may be NULL!

double AB_Value_GetValue const AB_VALUE v  ) 
 

Returns the value part as a double.

int AB_Value_IsEqual const AB_VALUE v1,
const AB_VALUE v2
 

Equality predicate: Returns nonzero (TRUE) if v1 is equal to v2, or zero (FALSE) otherwise. (Note: Right now this function ignores the currency field.)

int AB_Value_IsNegative const AB_VALUE v  ) 
 

Predicate: Returns nonzero (TRUE) if the value is negative (lesser than zero), or zero (FALSE) otherwise.

int AB_Value_IsPositive const AB_VALUE v  ) 
 

Predicate: Returns nonzero (TRUE) if the value is positive (greater or equal to zero), or zero (FALSE) otherwise.

int AB_Value_IsValid const AB_VALUE v  ) 
 

Predicate: Returns nonzero (TRUE) if the given value is valid. FIXME: Describe what "valid" means.

int AB_Value_IsZero const AB_VALUE v  ) 
 

Predicate: Returns nonzero (TRUE) if the value is equal to zero, or zero (FALSE) otherwise.

int AB_Value_Negate AB_VALUE v  ) 
 

Negate the sign of the given value, i.e. assign v=-v. Returns zero on succes, or -1 if any input argument is invalid.

AB_VALUE* AB_Value_new double  value,
const char *  currency
 

Create a new value with the given amount and the given ISO-4217 currency. (Constructor)

Parameters:
value The amount
currency The currency as ISO-4217 string, e.g. "EUR" for Euro; may be NULL

void AB_Value_SetCurrency AB_VALUE v,
const char *  s
 

Set the ISO-4217 currency string of this value, e.g. "EUR" for Euro. The currency string may be NULL.

void AB_Value_SetValue AB_VALUE v,
double  d
 

Set the value of this AB_VALUE from a double.

int AB_Value_SubValue AB_VALUE v,
const AB_VALUE vToSub
 

Subtract the value vToSub from the given value , i.e. assign v=v-vToSub. Returns zero on succes, or -1 if any input argument is invalid. (Note: Right now this function ignores the currency field.)

int AB_Value_toDb const AB_VALUE v,
GWEN_DB_NODE *  db
 

Write the given value into the given GWEN_DB.


Generated on Thu Oct 6 14:49:09 2005 for aqbanking by  doxygen 1.4.4