PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 671 of file pgsql2shp-core.c.

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