PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ goodDBFValue()

static char * goodDBFValue ( char *  in,
char  fieldType 
)
static

Make appropriate formatting of a DBF value based on type.

Might return untouched input or pointer to static private buffer: use return value right away.

Definition at line 664 of file pgsql2shp-core.c.

665 {
666  /*
667  * We only work on FTLogical and FTDate.
668  * FTLogical is 1 byte, FTDate is 8 byte (YYYYMMDD)
669  * We allocate space for 9 bytes to take
670  * terminating null into account
671  */
672  static char buf[9];
673 
674  switch (fieldType)
675  {
676  case FTLogical:
677  buf[0] = toupper(in[0]);
678  buf[1]='\0';
679  return buf;
680  case FTDate:
681  buf[0]=in[0]; /* Y */
682  buf[1]=in[1]; /* Y */
683  buf[2]=in[2]; /* Y */
684  buf[3]=in[3]; /* Y */
685  buf[4]=in[5]; /* M */
686  buf[5]=in[6]; /* M */
687  buf[6]=in[8]; /* D */
688  buf[7]=in[9]; /* D */
689  buf[8]='\0';
690  return buf;
691  default:
692  return in;
693  }
694 }
@ FTLogical
Definition: shapefil.h:642
@ FTDate
Definition: shapefil.h:643

References FTDate, and FTLogical.

Referenced by ShpLoaderGenerateShapeRow().

Here is the caller graph for this function: