GDAL
cpl_error_internal.h
1/**********************************************************************
2 * $Id$
3 *
4 * Name: cpl_error_internal.h
5 * Project: CPL - Common Portability Library
6 * Purpose: CPL Error handling
7 * Author: Even Rouault, <even.rouault at spatialys.com>
8 *
9 **********************************************************************
10 * Copyright (c) 2019, Even Rouault, <even.rouault at spatialys.com>
11 *
12 * SPDX-License-Identifier: MIT
13 ****************************************************************************/
14
15#ifndef CPL_ERROR_INTERNAL_H_INCLUDED
16#define CPL_ERROR_INTERNAL_H_INCLUDED
17
18#ifdef GDAL_COMPILATION
19// internal only
20
21#include "cpl_error.h"
22#include "cpl_string.h"
23#include <vector>
24
25/************************************************************************/
26/* ErrorHandlerAccumulator() */
27/************************************************************************/
28
29class CPL_DLL CPLErrorHandlerAccumulatorStruct
30{
31 public:
32 CPLErr type;
33 CPLErrorNum no;
34 CPLString msg{};
35
36 CPLErrorHandlerAccumulatorStruct() : type(CE_None), no(CPLE_None)
37 {
38 }
39
40 CPLErrorHandlerAccumulatorStruct(CPLErr eErrIn, CPLErrorNum noIn,
41 const char *msgIn)
42 : type(eErrIn), no(noIn), msg(msgIn)
43 {
44 }
45};
46
47void CPL_DLL CPLInstallErrorHandlerAccumulator(
48 std::vector<CPLErrorHandlerAccumulatorStruct> &aoErrors);
49void CPL_DLL CPLUninstallErrorHandlerAccumulator();
50
51#endif
52
53#endif // CPL_ERROR_INTERNAL_H_INCLUDED
Convenient string class based on std::string.
Definition: cpl_string.h:307
CPL error handling services.
#define CPLE_None
No error.
Definition: cpl_error.h:82
CPLErr
Error category.
Definition: cpl_error.h:37
int CPLErrorNum
Error number.
Definition: cpl_error.h:79
Various convenience functions for working with strings and string lists.