/**********************************************************
 * This file has been automatically created by "typemaker2"
 * from the file "security.xml".
 * Please do not edit this file, all changes will be lost.
 * Better edit the mentioned source file instead.
 **********************************************************/

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include "./security_p.h"

#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>

/* code headers */

/* macro functions */
GWEN_LIST_FUNCTIONS(AB_SECURITY, AB_Security)
GWEN_LIST2_FUNCTIONS(AB_SECURITY, AB_Security)


AB_SECURITY *AB_Security_new(void) {
  AB_SECURITY *p_struct;

  GWEN_NEW_OBJECT(AB_SECURITY, p_struct)
  p_struct->_refCount=1;
  GWEN_LIST_INIT(AB_SECURITY, p_struct)
  /* members */
  p_struct->name=NULL;
  p_struct->uniqueId=NULL;
  p_struct->nameSpace=NULL;
  p_struct->tickerSymbol=NULL;
  p_struct->units=AB_Value_new();
  p_struct->unitPriceValue=AB_Value_new();
  p_struct->unitPriceDate=NULL;
  /* virtual functions */

  return p_struct;
}

void AB_Security_free(AB_SECURITY *p_struct) {
  if (p_struct) {
  assert(p_struct->_refCount);
  if (p_struct->_refCount==1) {
    GWEN_LIST_FINI(AB_SECURITY, p_struct)
  /* members */
    free(p_struct->name); p_struct->name=NULL;
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    AB_Value_free(p_struct->units);
    AB_Value_free(p_struct->unitPriceValue);
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->_refCount=0;
    GWEN_FREE_OBJECT(p_struct);
  }
  else
    p_struct->_refCount--;
  }
}

void AB_Security_Attach(AB_SECURITY *p_struct) {
  assert(p_struct);
  assert(p_struct->_refCount);
  p_struct->_refCount++;
}

AB_SECURITY *AB_Security_dup(const AB_SECURITY *p_src) {
  AB_SECURITY *p_struct;

  assert(p_src);
  p_struct=AB_Security_new();
  /* member "name" */
  if (p_struct->name) {
    free(p_struct->name); p_struct->name=NULL;
    p_struct->name=NULL;
  }
  if (p_src->name) {
    p_struct->name=strdup(p_src->name);
  }


  /* member "uniqueId" */
  if (p_struct->uniqueId) {
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    p_struct->uniqueId=NULL;
  }
  if (p_src->uniqueId) {
    p_struct->uniqueId=strdup(p_src->uniqueId);
  }


  /* member "nameSpace" */
  if (p_struct->nameSpace) {
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    p_struct->nameSpace=NULL;
  }
  if (p_src->nameSpace) {
    p_struct->nameSpace=strdup(p_src->nameSpace);
  }


  /* member "tickerSymbol" */
  if (p_struct->tickerSymbol) {
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    p_struct->tickerSymbol=NULL;
  }
  if (p_src->tickerSymbol) {
    p_struct->tickerSymbol=strdup(p_src->tickerSymbol);
  }


  /* member "units" */
  if (p_struct->units) {
    AB_Value_free(p_struct->units);
    p_struct->units=NULL;
  }
  if (p_src->units) {
    p_struct->units=AB_Value_dup(p_src->units);
  }


  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) {
    AB_Value_free(p_struct->unitPriceValue);
    p_struct->unitPriceValue=NULL;
  }
  if (p_src->unitPriceValue) {
    p_struct->unitPriceValue=AB_Value_dup(p_src->unitPriceValue);
  }


  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate) {
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->unitPriceDate=NULL;
  }
  if (p_src->unitPriceDate) {
    p_struct->unitPriceDate=GWEN_Time_dup(p_src->unitPriceDate);
  }


  return p_struct;
}

AB_SECURITY *AB_Security_copy(AB_SECURITY *p_struct, const AB_SECURITY *p_src) {
  assert(p_struct);
  assert(p_src);
  /* member "name" */
  if (p_struct->name) {
    free(p_struct->name); p_struct->name=NULL;
    p_struct->name=NULL;
  }
  if (p_src->name) {
    p_struct->name=strdup(p_src->name);
  }


  /* member "uniqueId" */
  if (p_struct->uniqueId) {
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    p_struct->uniqueId=NULL;
  }
  if (p_src->uniqueId) {
    p_struct->uniqueId=strdup(p_src->uniqueId);
  }


  /* member "nameSpace" */
  if (p_struct->nameSpace) {
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    p_struct->nameSpace=NULL;
  }
  if (p_src->nameSpace) {
    p_struct->nameSpace=strdup(p_src->nameSpace);
  }


  /* member "tickerSymbol" */
  if (p_struct->tickerSymbol) {
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    p_struct->tickerSymbol=NULL;
  }
  if (p_src->tickerSymbol) {
    p_struct->tickerSymbol=strdup(p_src->tickerSymbol);
  }


  /* member "units" */
  if (p_struct->units) {
    AB_Value_free(p_struct->units);
    p_struct->units=NULL;
  }
  if (p_src->units) {
    p_struct->units=AB_Value_dup(p_src->units);
  }


  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) {
    AB_Value_free(p_struct->unitPriceValue);
    p_struct->unitPriceValue=NULL;
  }
  if (p_src->unitPriceValue) {
    p_struct->unitPriceValue=AB_Value_dup(p_src->unitPriceValue);
  }


  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate) {
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->unitPriceDate=NULL;
  }
  if (p_src->unitPriceDate) {
    p_struct->unitPriceDate=GWEN_Time_dup(p_src->unitPriceDate);
  }


  return p_struct;
}

const char *AB_Security_GetName(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->name;
}

const char *AB_Security_GetUniqueId(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->uniqueId;
}

const char *AB_Security_GetNameSpace(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->nameSpace;
}

const char *AB_Security_GetTickerSymbol(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->tickerSymbol;
}

const AB_VALUE *AB_Security_GetUnits(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->units;
}

const AB_VALUE *AB_Security_GetUnitPriceValue(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->unitPriceValue;
}

const GWEN_TIME *AB_Security_GetUnitPriceDate(const AB_SECURITY *p_struct){
  assert(p_struct);
  return p_struct->unitPriceDate;
}

void AB_Security_SetName(AB_SECURITY *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->name) {
    free(p_struct->name); p_struct->name=NULL;
    p_struct->name=NULL;
  }
  if (p_src) {
    p_struct->name=strdup(p_src);
  }
  else {
    p_struct->name=NULL;
  }

}

void AB_Security_SetUniqueId(AB_SECURITY *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->uniqueId) {
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    p_struct->uniqueId=NULL;
  }
  if (p_src) {
    p_struct->uniqueId=strdup(p_src);
  }
  else {
    p_struct->uniqueId=NULL;
  }

}

void AB_Security_SetNameSpace(AB_SECURITY *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->nameSpace) {
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    p_struct->nameSpace=NULL;
  }
  if (p_src) {
    p_struct->nameSpace=strdup(p_src);
  }
  else {
    p_struct->nameSpace=NULL;
  }

}

void AB_Security_SetTickerSymbol(AB_SECURITY *p_struct, const char *p_src){
  assert(p_struct);
  if (p_struct->tickerSymbol) {
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    p_struct->tickerSymbol=NULL;
  }
  if (p_src) {
    p_struct->tickerSymbol=strdup(p_src);
  }
  else {
    p_struct->tickerSymbol=NULL;
  }

}

void AB_Security_SetUnits(AB_SECURITY *p_struct, const AB_VALUE *p_src){
  assert(p_struct);
  if (p_struct->units) {
    AB_Value_free(p_struct->units);
    p_struct->units=NULL;
  }
  if (p_src) {
    p_struct->units=AB_Value_dup(p_src);
  }
  else {
    p_struct->units=NULL;
  }

}

void AB_Security_SetUnitPriceValue(AB_SECURITY *p_struct, const AB_VALUE *p_src){
  assert(p_struct);
  if (p_struct->unitPriceValue) {
    AB_Value_free(p_struct->unitPriceValue);
    p_struct->unitPriceValue=NULL;
  }
  if (p_src) {
    p_struct->unitPriceValue=AB_Value_dup(p_src);
  }
  else {
    p_struct->unitPriceValue=NULL;
  }

}

void AB_Security_SetUnitPriceDate(AB_SECURITY *p_struct, const GWEN_TIME *p_src){
  assert(p_struct);
  if (p_struct->unitPriceDate) {
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->unitPriceDate=NULL;
  }
  if (p_src) {
    p_struct->unitPriceDate=GWEN_Time_dup(p_src);
  }
  else {
    p_struct->unitPriceDate=NULL;
  }

}

AB_SECURITY_LIST *AB_Security_List_dup(const AB_SECURITY_LIST *p_src) {
  AB_SECURITY_LIST *p_dest;
  AB_SECURITY *p_elem;

  assert(p_src);
  p_dest=AB_Security_List_new();
  p_elem=AB_Security_List_First(p_src);
  while(p_elem) {
    AB_SECURITY *p_cpy;

    p_cpy=AB_Security_dup(p_elem);
    AB_Security_List_Add(p_cpy, p_dest);
    p_elem=AB_Security_List_Next(p_elem);
  }

  return p_dest;
}

void AB_Security_ReadDb(AB_SECURITY *p_struct, GWEN_DB_NODE *p_db){
  assert(p_struct);
  /* member "name" */
  if (p_struct->name) {
    free(p_struct->name); p_struct->name=NULL;
    p_struct->name=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "name", 0, NULL); if (s) p_struct->name=strdup(s); }
  /* member "uniqueId" */
  if (p_struct->uniqueId) {
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    p_struct->uniqueId=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "uniqueId", 0, NULL); if (s) p_struct->uniqueId=strdup(s); }
  /* member "nameSpace" */
  if (p_struct->nameSpace) {
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    p_struct->nameSpace=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "nameSpace", 0, NULL); if (s) p_struct->nameSpace=strdup(s); }
  /* member "tickerSymbol" */
  if (p_struct->tickerSymbol) {
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    p_struct->tickerSymbol=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "tickerSymbol", 0, NULL); if (s) p_struct->tickerSymbol=strdup(s); }
  /* member "units" */
  if (p_struct->units) {
    AB_Value_free(p_struct->units);
    p_struct->units=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "units", 0, NULL); if (s) p_struct->units=AB_Value_fromString(s); else p_struct->units=NULL; }
  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) {
    AB_Value_free(p_struct->unitPriceValue);
    p_struct->unitPriceValue=NULL;
  }
  { const char *s; s=GWEN_DB_GetCharValue(p_db, "unitPriceValue", 0, NULL); if (s) p_struct->unitPriceValue=AB_Value_fromString(s); else p_struct->unitPriceValue=NULL; }
  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate) {
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->unitPriceDate=NULL;
  }
  { GWEN_DB_NODE *dbDest; dbDest=GWEN_DB_GetGroup(p_db, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "unitPriceDate"); if (dbDest) p_struct->unitPriceDate=GWEN_Time_fromDb(dbDest); }
}

int AB_Security_WriteDb(const AB_SECURITY *p_struct, GWEN_DB_NODE *p_db) {
  int p_rv;

  assert(p_struct);
  /* member "name" */
  if (p_struct->name) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "name", p_struct->name); else { GWEN_DB_DeleteVar(p_db, "name"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "uniqueId" */
  if (p_struct->uniqueId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "uniqueId", p_struct->uniqueId); else { GWEN_DB_DeleteVar(p_db, "uniqueId"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "nameSpace" */
  if (p_struct->nameSpace) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "nameSpace", p_struct->nameSpace); else { GWEN_DB_DeleteVar(p_db, "nameSpace"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "tickerSymbol" */
  if (p_struct->tickerSymbol) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tickerSymbol", p_struct->tickerSymbol); else { GWEN_DB_DeleteVar(p_db, "tickerSymbol"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "units" */
  if (p_struct->units) { GWEN_BUFFER *tbuf=GWEN_Buffer_new(0, 64, 0, 1); AB_Value_toString(p_struct->units, tbuf); p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "units", GWEN_Buffer_GetStart(tbuf)); GWEN_Buffer_free(tbuf); } else { GWEN_DB_DeleteVar(p_db, "units"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) { GWEN_BUFFER *tbuf=GWEN_Buffer_new(0, 64, 0, 1); AB_Value_toString(p_struct->unitPriceValue, tbuf); p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "unitPriceValue", GWEN_Buffer_GetStart(tbuf)); GWEN_Buffer_free(tbuf); } else { GWEN_DB_DeleteVar(p_db, "unitPriceValue"); p_rv=0; }
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate){ GWEN_DB_NODE *dbDest; dbDest=GWEN_DB_GetGroup(p_db, GWEN_DB_FLAGS_OVERWRITE_GROUPS, "unitPriceDate"); assert(dbDest); p_rv=GWEN_Time_toDb(p_struct->unitPriceDate, dbDest); } else p_rv=0;
  if (p_rv<0) {
    DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
    return p_rv;
  }


  return 0;
}

AB_SECURITY *AB_Security_fromDb(GWEN_DB_NODE *p_db) {
  AB_SECURITY *p_struct;
  p_struct=AB_Security_new();
  AB_Security_ReadDb(p_struct, p_db);
  return p_struct;
}

int AB_Security_toDb(const AB_SECURITY *p_struct, GWEN_DB_NODE *p_db) {
  return AB_Security_WriteDb(p_struct, p_db);
}

void AB_Security_ReadXml(AB_SECURITY *p_struct, GWEN_XMLNODE *p_db){
  assert(p_struct);
  /* member "name" */
  if (p_struct->name) {
    free(p_struct->name); p_struct->name=NULL;
    p_struct->name=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "name", NULL); if (s) p_struct->name=strdup(s); }
  /* member "uniqueId" */
  if (p_struct->uniqueId) {
    free(p_struct->uniqueId); p_struct->uniqueId=NULL;
    p_struct->uniqueId=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "uniqueId", NULL); if (s) p_struct->uniqueId=strdup(s); }
  /* member "nameSpace" */
  if (p_struct->nameSpace) {
    free(p_struct->nameSpace); p_struct->nameSpace=NULL;
    p_struct->nameSpace=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "nameSpace", NULL); if (s) p_struct->nameSpace=strdup(s); }
  /* member "tickerSymbol" */
  if (p_struct->tickerSymbol) {
    free(p_struct->tickerSymbol); p_struct->tickerSymbol=NULL;
    p_struct->tickerSymbol=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "tickerSymbol", NULL); if (s) p_struct->tickerSymbol=strdup(s); }
  /* member "units" */
  if (p_struct->units) {
    AB_Value_free(p_struct->units);
    p_struct->units=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "units", NULL); if (s) p_struct->units=AB_Value_fromString(s); else p_struct->units=NULL; }
  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) {
    AB_Value_free(p_struct->unitPriceValue);
    p_struct->unitPriceValue=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "unitPriceValue", NULL); if (s) p_struct->unitPriceValue=AB_Value_fromString(s); else p_struct->unitPriceValue=NULL; }
  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate) {
    GWEN_Time_free(p_struct->unitPriceDate); p_struct->unitPriceDate=NULL;
    p_struct->unitPriceDate=NULL;
  }
  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "unitPriceDate", NULL); if (s && *s) p_struct->unitPriceDate=GWEN_Time_fromString(s, "YYYY/MM/DD-hh:mm"); }
}

void AB_Security_WriteXml(const AB_SECURITY *p_struct, GWEN_XMLNODE *p_db) {
  assert(p_struct);
  /* member "name" */
  GWEN_XMLNode_SetCharValue(p_db, "name", p_struct->name);


  /* member "uniqueId" */
  GWEN_XMLNode_SetCharValue(p_db, "uniqueId", p_struct->uniqueId);


  /* member "nameSpace" */
  GWEN_XMLNode_SetCharValue(p_db, "nameSpace", p_struct->nameSpace);


  /* member "tickerSymbol" */
  GWEN_XMLNode_SetCharValue(p_db, "tickerSymbol", p_struct->tickerSymbol);


  /* member "units" */
  if (p_struct->units) { GWEN_BUFFER *tbuf=GWEN_Buffer_new(0, 64, 0, 1); AB_Value_toString(p_struct->units, tbuf); GWEN_XMLNode_SetCharValue(p_db, "units", GWEN_Buffer_GetStart(tbuf)); GWEN_Buffer_free(tbuf); }


  /* member "unitPriceValue" */
  if (p_struct->unitPriceValue) { GWEN_BUFFER *tbuf=GWEN_Buffer_new(0, 64, 0, 1); AB_Value_toString(p_struct->unitPriceValue, tbuf); GWEN_XMLNode_SetCharValue(p_db, "unitPriceValue", GWEN_Buffer_GetStart(tbuf)); GWEN_Buffer_free(tbuf); }


  /* member "unitPriceDate" */
  if (p_struct->unitPriceDate){ GWEN_BUFFER *xbuf; int rv; xbuf=GWEN_Buffer_new(0, 32, 0, 1); rv=GWEN_Time_toString(p_struct->unitPriceDate, "YYYY/MM/DD-hh:mm", xbuf); if (rv>=0) GWEN_XMLNode_SetCharValue(p_db, "unitPriceDate", GWEN_Buffer_GetStart(xbuf)); GWEN_Buffer_free(xbuf); }


}

void AB_Security_toXml(const AB_SECURITY *p_struct, GWEN_XMLNODE *p_db) {
  AB_Security_WriteXml(p_struct, p_db);
}

AB_SECURITY *AB_Security_fromXml(GWEN_XMLNODE *p_db) {
  AB_SECURITY *p_struct;
  p_struct=AB_Security_new();
  AB_Security_ReadXml(p_struct, p_db);
  return p_struct;
}

void AB_Security_toHashString(const AB_SECURITY *p_struct, GWEN_BUFFER *p_buffer) {
  assert(p_struct);
  /* member "name"*/
  if (p_struct->name) GWEN_Buffer_AppendString(p_buffer, p_struct->name);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "uniqueId"*/
  if (p_struct->uniqueId) GWEN_Buffer_AppendString(p_buffer, p_struct->uniqueId);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "nameSpace"*/
  if (p_struct->nameSpace) GWEN_Buffer_AppendString(p_buffer, p_struct->nameSpace);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "tickerSymbol"*/
  if (p_struct->tickerSymbol) GWEN_Buffer_AppendString(p_buffer, p_struct->tickerSymbol);
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "units"*/
  if (p_struct->units) { double d=AB_Value_GetValueAsDouble(p_struct->units); char numbuf[32]; snprintf(numbuf, sizeof(numbuf)-1, "%.4f", d); numbuf[sizeof(numbuf)-1]=0; GWEN_Buffer_AppendString(p_buffer, numbuf); }
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "unitPriceValue"*/
  if (p_struct->unitPriceValue) { double d=AB_Value_GetValueAsDouble(p_struct->unitPriceValue); char numbuf[32]; snprintf(numbuf, sizeof(numbuf)-1, "%.4f", d); numbuf[sizeof(numbuf)-1]=0; GWEN_Buffer_AppendString(p_buffer, numbuf); }
  GWEN_Buffer_AppendByte(p_buffer, ':');
  /* member "unitPriceDate"*/
  if (p_struct->unitPriceDate) GWEN_Time_toUtcString(p_struct->unitPriceDate, "YYYY/MM/DD-hh:mm", p_buffer);
  GWEN_Buffer_AppendByte(p_buffer, ':');
}

static AB_SECURITY *AB_Security_List2__freeAll_cb(AB_SECURITY *t, void *user_data) { AB_Security_free(t); return NULL; } int AB_Security_List2_freeAll(AB_SECURITY_LIST2 *tl) { if (tl) { AB_Security_List2_ForEach(tl, AB_Security_List2__freeAll_cb, NULL); AB_Security_List2_free(tl); } else { DBG_ERROR(AQBANKING_LOGDOMAIN, "List missing"); return GWEN_ERROR_INVALID; } return 0; }

/* code headers */

