-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathdbf.cpp
More file actions
46 lines (39 loc) · 1.34 KB
/
dbf.cpp
File metadata and controls
46 lines (39 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "stdafx.h"
#include "dbf.h"
#include "shapefil.h"
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#ifndef FALSE
# define FALSE 0
# define TRUE 1
#endif
DBFHandle SHPAPI_CALL DBFOpen_MW( CStringW pszFilename, const char * pszAccess )
{
CStringA nameA = Utility::ConvertToUtf8(pszFilename);
m_globalSettings.SetGdalUtf8(true);
DBFHandle handle = DBFOpen(nameA, pszAccess);
m_globalSettings.SetGdalUtf8(false);
return handle;
}
DBFHandle SHPAPI_CALL DBFCreate_MW( CStringW nameW )
{
CStringA nameA = Utility::ConvertToUtf8(nameW);
m_globalSettings.SetGdalUtf8(true);
DBFHandle handle = DBFCreate(nameA);
m_globalSettings.SetGdalUtf8(false);
return handle;
}
/************************************************************************/
/* SfRealloc() */
/* */
/* A realloc cover function that will access a NULL pointer as */
/* a valid input. */
/************************************************************************/
static void * SfRealloc( void * pMem, int nNewSize )
{
if( pMem == NULL )
return( (void *) malloc(nNewSize) );
else
return( (void *) realloc(pMem,nNewSize) );
}