30 #ifndef COMMONUTILS_H_INCLUDED
31 #define COMMONUTILS_H_INCLUDED
37 #if defined(WIN32) && (defined(_MSC_VER) || defined(SUPPORTS_WMAIN))
48 explicit ARGVDestroyer(
char** papszList) : m_papszList(papszList) {}
52 extern "C" int wmain(
int argc,
wchar_t ** argv_w,
wchar_t ** );
54 #define MAIN_START(argc, argv) \
56 int wmain( int argc, wchar_t ** argv_w, wchar_t ** ) \
58 char **argv = static_cast<char**>(CPLCalloc(argc + 1, sizeof(char*))); \
59 for( int i = 0; i < argc; i++ ) \
61 argv[i] = CPLRecodeFromWChar( argv_w[i], CPL_ENC_UCS2, CPL_ENC_UTF8 ); \
63 ARGVDestroyer argvDestroyer(argv);
67 #else // defined(WIN32)
69 #define MAIN_START(argc, argv) \
70 int main( int argc, char ** argv )
74 #endif // defined(WIN32)
75 #endif // defined(__cplusplus)
80 void CPL_DLL EarlySetConfigOptions(
int argc,
char ** argv );
89 std::vector<CPLString> CPL_DLL GetOutputDriversFor(
const char* pszDestFilename,
90 int nFlagRasterVector);
91 CPLString CPL_DLL GetOutputDriverForRaster(
const char* pszDestFilename);
Convenient string class based on std::string.
Definition: cpl_string.h:330
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:337
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:339
Various convenience functions for CPL.
Various convenience functions for working with strings and string lists.
void CSLDestroy(char **papszStrList)
Free string list.
Definition: cpl_string.cpp:200
Core portability definitions for CPL.
Generated for GDAL by
1.8.20.