30 #ifndef COMMONUTILS_H_INCLUDED
31 #define COMMONUTILS_H_INCLUDED
37 #if defined(_WIN32) && (defined(_MSC_VER) || defined(SUPPORTS_WMAIN))
46 char **m_papszList =
nullptr;
47 ARGVDestroyer(
const ARGVDestroyer &) =
delete;
48 ARGVDestroyer &operator=(
const ARGVDestroyer &) =
delete;
51 explicit ARGVDestroyer(
char **papszList) : m_papszList(papszList)
61 extern "C" int wmain(
int argc,
wchar_t **argv_w,
wchar_t ** );
63 #define MAIN_START(argc, argv) \
64 extern "C" int wmain(int argc, wchar_t **argv_w, wchar_t **
) \
67 static_cast<char **>(CPLCalloc(argc + 1, sizeof(char *))); \
68 for (int i = 0; i < argc; i++) \
71 CPLRecodeFromWChar(argv_w[i], CPL_ENC_UCS2, CPL_ENC_UTF8); \
73 ARGVDestroyer argvDestroyer(argv); \
79 #define MAIN_START(argc, argv) \
80 int main(int argc, char **argv) \
89 catch (const std::exception &e) \
91 fprintf(stderr, "Unexpected exception: %s", e.what()); \
100 void CPL_DLL EarlySetConfigOptions(
int argc,
char **argv);
109 std::vector<std::string> CPL_DLL
110 GetOutputDriversFor(
const char *pszDestFilename,
int nFlagRasterVector);
111 CPLString CPL_DLL GetOutputDriverForRaster(
const char *pszDestFilename);
112 void GDALRemoveBOM(
GByte *pabyData);
113 std::string GDALRemoveSQLComments(
const std::string &osInput);
115 int ArgIsNumeric(
const char *pszArg);
120 constexpr
int OVR_LEVEL_AUTO = -2;
121 constexpr
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:299
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
unsigned char GByte
Unsigned byte type.
Definition: cpl_port.h:185
Various convenience functions for working with strings and string lists.
void CSLDestroy(char **papszStrList)
Free string list.
Definition: cpl_string.cpp:200