1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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");
30 switch (err
.GetArea())
35 case ErrCodeArea::Sfx
:
38 case ErrCodeArea::Inet
:
41 case ErrCodeArea::Vcl
:
44 case ErrCodeArea::Svx
:
50 case ErrCodeArea::Sbx
:
53 case ErrCodeArea::Uui
:
69 switch (err
.GetClass())
71 case ErrCodeClass::NONE
:
74 case ErrCodeClass::Abort
:
77 case ErrCodeClass::General
:
80 case ErrCodeClass::NotExists
:
83 case ErrCodeClass::AlreadyExists
:
84 os
<< "AlreadyExists";
86 case ErrCodeClass::Access
:
89 case ErrCodeClass::Path
:
92 case ErrCodeClass::Locking
:
95 case ErrCodeClass::Parameter
:
98 case ErrCodeClass::Space
:
101 case ErrCodeClass::NotSupported
:
102 os
<< "NotSupported";
104 case ErrCodeClass::Read
:
107 case ErrCodeClass::Write
:
110 case ErrCodeClass::Unknown
:
113 case ErrCodeClass::Version
:
116 case ErrCodeClass::Format
:
119 case ErrCodeClass::Create
:
122 case ErrCodeClass::Import
:
125 case ErrCodeClass::Export
:
128 case ErrCodeClass::So
:
131 case ErrCodeClass::Sbx
:
134 case ErrCodeClass::Runtime
:
137 case ErrCodeClass::Compiler
:
141 os
<< " Code:" << OUString::number(err
.GetCode());
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */