14#ifndef COMMONUTILS_H_INCLUDED
15#define COMMONUTILS_H_INCLUDED
21#if defined(_WIN32) && (defined(_MSC_VER) || defined(SUPPORTS_WMAIN))
30 char **m_papszList =
nullptr;
31 ARGVDestroyer(
const ARGVDestroyer &) =
delete;
32 ARGVDestroyer &operator=(
const ARGVDestroyer &) =
delete;
35 explicit ARGVDestroyer(
char **papszList) : m_papszList(papszList)
45extern "C" int wmain(
int argc,
wchar_t **argv_w,
wchar_t ** );
47#define MAIN_START(argc, argv) \
48 extern "C" int wmain(int argc, wchar_t **argv_w, wchar_t **
) \
51 static_cast<char **>(CPLCalloc(argc + 1, sizeof(char *))); \
52 for (int i = 0; i < argc; i++) \
55 CPLRecodeFromWChar(argv_w[i], CPL_ENC_UCS2, CPL_ENC_UTF8); \
57 ARGVDestroyer argvDestroyer(argv); \
63#define MAIN_START(argc, argv) \
64 int main(int argc, char **argv) \
73 catch (const std::exception &e) \
75 fprintf(stderr, "Unexpected exception: %s", e.what()); \
84void CPL_DLL EarlySetConfigOptions(
int argc,
char **argv);
93std::vector<std::string> CPL_DLL
94GetOutputDriversFor(
const char *pszDestFilename,
int nFlagRasterVector);
95CPLString CPL_DLL GetOutputDriverForRaster(
const char *pszDestFilename);
96void GDALRemoveBOM(
GByte *pabyData);
97std::string GDALRemoveSQLComments(
const std::string &osInput);
99int ArgIsNumeric(
const char *pszArg);
104constexpr int OVR_LEVEL_AUTO = -2;
105constexpr int OVR_LEVEL_NONE = -1;
Convenient string class based on std::string.
Definition: cpl_string.h:307
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:283
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:279
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:169
Various convenience functions for working with strings and string lists.
void CSLDestroy(char **papszStrList)
Free string list.
Definition: cpl_string.cpp:185