13#ifndef COMMONUTILS_H_INCLUDED
14#define COMMONUTILS_H_INCLUDED
20#if defined(_WIN32) && (defined(_MSC_VER) || defined(SUPPORTS_WMAIN))
29 char **m_papszList =
nullptr;
30 ARGVDestroyer(
const ARGVDestroyer &) =
delete;
31 ARGVDestroyer &operator=(
const ARGVDestroyer &) =
delete;
34 explicit ARGVDestroyer(
char **papszList) : m_papszList(papszList)
40 CSLDestroy(m_papszList);
44extern "C" int wmain(
int argc,
wchar_t **argv_w,
wchar_t ** );
46#define MAIN_START(argc, argv) \
47 extern "C" int wmain(int argc, wchar_t **argv_w, wchar_t ** ) \
50 static_cast<char **>(CPLCalloc(argc + 1, sizeof(char *))); \
51 for (int i = 0; i < argc; i++) \
54 CPLRecodeFromWChar(argv_w[i], CPL_ENC_UCS2, CPL_ENC_UTF8); \
56 ARGVDestroyer argvDestroyer(argv); \
62#define MAIN_START(argc, argv) \
63 int main(int argc, char **argv) \
72 catch (const std::exception &e) \
74 fprintf(stderr, "Unexpected exception: %s", e.what()); \
83void CPL_DLL EarlySetConfigOptions(
int argc,
char **argv);
92std::vector<std::string> CPL_DLL
93GetOutputDriversFor(
const char *pszDestFilename,
int nFlagRasterVector);
94CPLString CPL_DLL GetOutputDriverForRaster(
const char *pszDestFilename);
95void GDALRemoveBOM(
GByte *pabyData);
97int ArgIsNumeric(
const char *pszArg);
99bool GDALPatternMatch(
const char *input,
const char *pattern);
104constexpr int OVR_LEVEL_AUTO = -2;
105constexpr int OVR_LEVEL_NONE = -1;
Convenient string class based on std::string.
Definition cpl_string.h:320
Various convenience functions for CPL.
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Various convenience functions for working with strings and string lists.