PostGIS  2.1.10dev-r@@SVN_REVISION@@
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 654 of file pgsql2shp-core.c.

Referenced by ShpLoaderGenerateShapeRow().

655 {
656  /*
657  * We only work on FTLogical and FTDate.
658  * FTLogical is 1 byte, FTDate is 8 byte (YYYYMMDD)
659  * We allocate space for 9 bytes to take
660  * terminating null into account
661  */
662  static char buf[9];
663 
664  switch (fieldType)
665  {
666  case FTLogical:
667  buf[0] = toupper(in[0]);
668  buf[1]='\0';
669  return buf;
670  case FTDate:
671  buf[0]=in[0]; /* Y */
672  buf[1]=in[1]; /* Y */
673  buf[2]=in[2]; /* Y */
674  buf[3]=in[3]; /* Y */
675  buf[4]=in[5]; /* M */
676  buf[5]=in[6]; /* M */
677  buf[6]=in[8]; /* D */
678  buf[7]=in[9]; /* D */
679  buf[8]='\0';
680  return buf;
681  default:
682  return in;
683  }
684 }

Here is the caller graph for this function: