bump product version to 6.4.0.3
[LibreOffice.git] / vcl / source / helper / errcode.cxx
blobd50bf522c7d8ce914b6c429965acd2f1c5dd283d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <vcl/errcode.hxx>
22 VCL_DLLPUBLIC std::ostream& operator<<(std::ostream& os, const ErrCode& err)
24 os << err.toHexString() << "(" << (err.IsWarning() ? "Warning" : "Error");
25 if (err.IsDynamic())
26 os << " Dynamic";
27 else
29 os << " Area:";
30 switch (err.GetArea())
32 case ErrCodeArea::Io:
33 os << "Io";
34 break;
35 case ErrCodeArea::Sfx:
36 os << "Sfx";
37 break;
38 case ErrCodeArea::Inet:
39 os << "Inet";
40 break;
41 case ErrCodeArea::Vcl:
42 os << "Vcl";
43 break;
44 case ErrCodeArea::Svx:
45 os << "Svx";
46 break;
47 case ErrCodeArea::So:
48 os << "So";
49 break;
50 case ErrCodeArea::Sbx:
51 os << "Sbx";
52 break;
53 case ErrCodeArea::Uui:
54 os << "Uui";
55 break;
56 case ErrCodeArea::Sc:
57 os << "Sc";
58 break;
59 case ErrCodeArea::Sd:
60 os << "Sd";
61 break;
62 case ErrCodeArea::Sw:
63 os << "Sw";
64 break;
65 default:
66 os << "Unknown";
68 os << " Class:";
69 switch (err.GetClass())
71 case ErrCodeClass::NONE:
72 os << "NONE";
73 break;
74 case ErrCodeClass::Abort:
75 os << "Abort";
76 break;
77 case ErrCodeClass::General:
78 os << "General";
79 break;
80 case ErrCodeClass::NotExists:
81 os << "NotExists";
82 break;
83 case ErrCodeClass::AlreadyExists:
84 os << "AlreadyExists";
85 break;
86 case ErrCodeClass::Access:
87 os << "Access";
88 break;
89 case ErrCodeClass::Path:
90 os << "Path";
91 break;
92 case ErrCodeClass::Locking:
93 os << "Locking";
94 break;
95 case ErrCodeClass::Parameter:
96 os << "Parameter";
97 break;
98 case ErrCodeClass::Space:
99 os << "Space";
100 break;
101 case ErrCodeClass::NotSupported:
102 os << "NotSupported";
103 break;
104 case ErrCodeClass::Read:
105 os << "Read";
106 break;
107 case ErrCodeClass::Write:
108 os << "Write";
109 break;
110 case ErrCodeClass::Unknown:
111 os << "Unknown";
112 break;
113 case ErrCodeClass::Version:
114 os << "Version";
115 break;
116 case ErrCodeClass::Format:
117 os << "Format";
118 break;
119 case ErrCodeClass::Create:
120 os << "Create";
121 break;
122 case ErrCodeClass::Import:
123 os << "Import";
124 break;
125 case ErrCodeClass::Export:
126 os << "Export";
127 break;
128 case ErrCodeClass::So:
129 os << "So";
130 break;
131 case ErrCodeClass::Sbx:
132 os << "Sbx";
133 break;
134 case ErrCodeClass::Runtime:
135 os << "Runtime";
136 break;
137 case ErrCodeClass::Compiler:
138 os << "Compiler";
139 break;
141 os << " Code:" << OUString::number(err.GetCode());
143 os << ")";
144 return os;
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */