diff --git a/ogr/ogr_api.h b/ogr/ogr_api.h index 8b87c4334bfc..e03178ffe101 100644 --- a/ogr/ogr_api.h +++ b/ogr/ogr_api.h @@ -726,7 +726,7 @@ OGRFeatureH CPL_DLL OGR_L_GetNextFeature(OGRLayerH) CPL_WARN_UNUSED_RESULT; /** Conveniency macro to iterate over features of a layer. * * Typical usage is: - *
+ * \code{.cpp} * OGR_FOR_EACH_FEATURE_BEGIN(hFeat, hLayer) * { * // Do something, including continue, break; @@ -734,14 +734,14 @@ OGRFeatureH CPL_DLL OGR_L_GetNextFeature(OGRLayerH) CPL_WARN_UNUSED_RESULT; * // outside of the loop, in which case use OGR_F_Destroy(hFeat)) * } * OGR_FOR_EACH_FEATURE_END(hFeat) - *+ * \endcode * * In C++, you might want to use instead range-based loop: - *
+ * \code{.cpp} * for( auto&& poFeature: poLayer ) * { * } - *+ * \endcode * * @param hFeat variable name for OGRFeatureH. The variable will be declared * inside the macro body. diff --git a/ogr/ogr_feature.h b/ogr/ogr_feature.h index f5372a17374a..ab94bee5c54b 100644 --- a/ogr/ogr_feature.h +++ b/ogr/ogr_feature.h @@ -1135,13 +1135,13 @@ class CPL_DLL OGRFeature * (dereference) more than one iterator step at a time, since you will get * a reference to the same object (FieldValue) at each iteration step. * - *
+ * \code{.cpp} * for( auto&& oField: poFeature ) * { * std::cout << oField.GetIndex() << "," << oField.GetName()<< ": " << * oField.GetAsString() << std::endl; * } - *+ * \endcode * * @since GDAL 2.3 */ diff --git a/ogr/ogrsf_frmts/ogrsf_frmts.dox b/ogr/ogrsf_frmts/ogrsf_frmts.dox index 0b25e2888b02..d9e7734188eb 100644 --- a/ogr/ogrsf_frmts/ogrsf_frmts.dox +++ b/ogr/ogrsf_frmts/ogrsf_frmts.dox @@ -47,9 +47,9 @@ otherwise a handle to a GDALDataset. This GDALDataset should be closed by deleting the object when it is no longer needed. - Example: + Example: -
+ \code{.cpp} OGRDataSourceH hDS; OGRSFDriverH *pahDriver; @@ -62,7 +62,7 @@ ... use the data source ... OGRReleaseDataSource( hDS ); -+ \endcode */ @@ -99,9 +99,9 @@ otherwise a handle to a GDALDataset. This GDALDataset should be closed by deleting the object when it is no longer needed. - Example: + Example: -
+ \code{.cpp} OGRDataSourceH hDS; OGRSFDriverH *pahDriver; @@ -114,7 +114,7 @@ ... use the data source ... OGRReleaseDataSource( hDS ); -+ \endcode */ diff --git a/port/cpl_conv.cpp b/port/cpl_conv.cpp index 0f160d6faaaa..398da6c0f228 100644 --- a/port/cpl_conv.cpp +++ b/port/cpl_conv.cpp @@ -1665,7 +1665,7 @@ static void CPLAccessConfigOption(const char *pszKey, bool bGet) * * To override temporary a potentially existing option with a new value, you * can use the following snippet : - *
+ * \code{.cpp} * // backup old value * const char* pszOldValTmp = CPLGetConfigOption(pszKey, NULL); * char* pszOldVal = pszOldValTmp ? CPLStrdup(pszOldValTmp) : NULL; @@ -1675,7 +1675,7 @@ static void CPLAccessConfigOption(const char *pszKey, bool bGet) * // restore old value * CPLSetConfigOption(pszKey, pszOldVal); * CPLFree(pszOldVal); - *+ * \endcode * * @param pszKey the key of the option to retrieve * @param pszDefault a default value if the key does not match existing defined diff --git a/port/cpl_csv.cpp b/port/cpl_csv.cpp index 511238d21f47..6acf55fe234c 100644 --- a/port/cpl_csv.cpp +++ b/port/cpl_csv.cpp @@ -1476,13 +1476,13 @@ will take in a CSV filename and return a full path to the file. The returned string should be to an internal static buffer so that the caller doesn't have to free the result. -Example:
+put into CSVDirName). -
+\code{.cpp} ... SetCSVFilenameHook( CSVFileOverride ); @@ -1497,7 +1497,7 @@ static const char *CSVFileOverride( const char * pszInput ) return szPath; } -+\endcode */ diff --git a/port/cpl_error.cpp b/port/cpl_error.cpp index b25c6511d4aa..79296abe7fb6 100644 --- a/port/cpl_error.cpp +++ b/port/cpl_error.cpp @@ -1263,9 +1263,9 @@ CPLSetErrorHandlerEx(CPLErrorHandler pfnErrorHandlerNew, void *pUserData) * Allow the library's user to specify an error handler function. * A valid error handler is a C function with the following prototype: * - *
+ * \code{.cpp} * void MyErrorHandler(CPLErr eErrClass, int err_no, const char *msg) - *+ * \endcode * * Pass NULL to come back to the default behavior. The default behavior * (CPLDefaultErrorHandler()) is to write the message to stderr. diff --git a/port/cpl_path.cpp b/port/cpl_path.cpp index 3d98a668adab..f5733d8e5eea 100644 --- a/port/cpl_path.cpp +++ b/port/cpl_path.cpp @@ -110,13 +110,13 @@ static int CPLFindFilenameStart(const char *pszFilename, size_t nStart = 0) * filename. If there is no path in the passed filename an empty string * will be returned (not NULL). * - *
+ * \code{.cpp} * CPLGetPath( "abc/def.xyz" ) == "abc" * CPLGetPath( "/abc/def/" ) == "/abc/def" * CPLGetPath( "/" ) == "/" * CPLGetPath( "/abc/def" ) == "/abc" * CPLGetPath( "abc" ) == "" - *+ * \endcode * * @param pszFilename the filename potentially including a path. * @@ -179,13 +179,13 @@ const char *CPLGetPath(const char *pszFilename) * filename. If there is no path in the passed filename the dot will be * returned. It is the only difference from CPLGetPath(). * - *
+ * \code{.cpp} * CPLGetDirname( "abc/def.xyz" ) == "abc" * CPLGetDirname( "/abc/def/" ) == "/abc/def" * CPLGetDirname( "/" ) == "/" * CPLGetDirname( "/abc/def" ) == "/abc" * CPLGetDirname( "abc" ) == "." - *+ * \endcode * * @param pszFilename the filename potentially including a path. * @@ -248,11 +248,11 @@ const char *CPLGetDirname(const char *pszFilename) * filename. If there is no filename (passed value ends in trailing directory * separator) an empty string is returned. * - *
+ * \code{.cpp} * CPLGetFilename( "abc/def.xyz" ) == "def.xyz" * CPLGetFilename( "/abc/def/" ) == "" * CPLGetFilename( "abc/def" ) == "def" - *+ * \endcode * * @param pszFullFilename the full filename potentially including a path. * @@ -279,11 +279,11 @@ const char *CPLGetFilename(const char *pszFullFilename) * name. If there is no basename (passed value ends in trailing directory * separator, or filename starts with a dot) an empty string is returned. * - *
+ * \code{.cpp} * CPLGetBasename( "abc/def.xyz" ) == "def" * CPLGetBasename( "abc/def" ) == "def" * CPLGetBasename( "abc/def/" ) == "" - *+ * \endcode * * @param pszFullFilename the full filename potentially including a path. * @@ -334,10 +334,10 @@ const char *CPLGetBasename(const char *pszFullFilename) * name. If there is no extension (the filename has no dot) an empty string * is returned. The returned extension will not include the period. * - *
+ * \code{.cpp} * CPLGetExtension( "abc/def.xyz" ) == "xyz" * CPLGetExtension( "abc/def" ) == "" - *+ * \endcode * * @param pszFullFilename the full filename potentially including a path. * @@ -504,12 +504,12 @@ const char *CPLResetExtension(const char *pszPath, const char *pszExt) * The path, and extension are optional. The basename may in fact contain * an extension if desired. * - *
+ * \code{.cpp} * CPLFormFilename("abc/xyz", "def", ".dat" ) == "abc/xyz/def.dat" * CPLFormFilename(NULL,"def", NULL ) == "def" * CPLFormFilename(NULL, "abc/def.dat", NULL ) == "abc/def.dat" * CPLFormFilename("/abc/xyz/", "def.dat", NULL ) == "/abc/xyz/def.dat" - *+ * \endcode * * @param pszPath directory path to the directory containing the file. This * may be relative or absolute, and may have a trailing path separator or @@ -733,13 +733,13 @@ const char *CPLFormCIFilename(const char *pszPath, const char *pszBasename, * absolute, rather than relative, then it will be returned unaltered. * * Examples: - *
+ * \code{.cpp} * CPLProjectRelativeFilename("abc/def", "tmp/abc.gif") == "abc/def/tmp/abc.gif" * CPLProjectRelativeFilename("abc/def", "/tmp/abc.gif") == "/tmp/abc.gif" * CPLProjectRelativeFilename("/xy", "abc.gif") == "/xy/abc.gif" * CPLProjectRelativeFilename("/abc/def", "../abc.gif") == "/abc/def/../abc.gif" * CPLProjectRelativeFilename("C:\WIN", "abc.gif") == "C:\WIN\abc.gif" - *+ * \endcode * * @param pszProjectDir the directory relative to which the secondary files * path should be interpreted. @@ -924,13 +924,13 @@ const char *CPLExtractRelativePath(const char *pszBaseDir, * trailing slash removed. If there is no path in the passed filename * an empty string will be returned (not NULL). * - *
+ * \code{.cpp} * CPLCleanTrailingSlash( "abc/def/" ) == "abc/def" * CPLCleanTrailingSlash( "abc/def" ) == "abc/def" * CPLCleanTrailingSlash( "c:\\abc\\def\\" ) == "c:\\abc\\def" * CPLCleanTrailingSlash( "c:\\abc\\def" ) == "c:\\abc\\def" * CPLCleanTrailingSlash( "abc" ) == "abc" - *+ * \endcode * * @param pszPath the path to be cleaned up * diff --git a/port/cpl_vsil_curl.cpp b/port/cpl_vsil_curl.cpp index f4edce0ed423..4a16326f40c9 100644 --- a/port/cpl_vsil_curl.cpp +++ b/port/cpl_vsil_curl.cpp @@ -6344,7 +6344,7 @@ void VSINetworkStatsReset(void) * the CPL_VSIL_SHOW_NETWORK_STATS configuration option is set to YES. * * Example of output: - *
+ * \code{.js} * { * "methods":{ * "GET":{ @@ -6414,8 +6414,7 @@ void VSINetworkStatsReset(void) * } * } * } - - *+ * \endcode * * @param papszOptions Unused. * @return a JSON serialized string to free with VSIFree(), or nullptr