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

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

Referenced by ShpLoaderGenerateShapeRow().

Here is the caller graph for this function: