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

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

Referenced by ShpLoaderGenerateShapeRow().

Here is the caller graph for this function: