PostGIS  3.4.0dev-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 667 of file pgsql2shp-core.c.

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