xref: /AOO41X/main/shell/source/all/zipfile/zipexcptn.cxx (revision f8e2c85a611dbc087707e0b32c9aee1ddf7485ca)
1*f8e2c85aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f8e2c85aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f8e2c85aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f8e2c85aSAndrew Rist  * distributed with this work for additional information
6*f8e2c85aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f8e2c85aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f8e2c85aSAndrew Rist  * "License"); you may not use this file except in compliance
9*f8e2c85aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*f8e2c85aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*f8e2c85aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f8e2c85aSAndrew Rist  * software distributed under the License is distributed on an
15*f8e2c85aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f8e2c85aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*f8e2c85aSAndrew Rist  * specific language governing permissions and limitations
18*f8e2c85aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*f8e2c85aSAndrew Rist  *************************************************************/
21*f8e2c85aSAndrew Rist 
22*f8e2c85aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_shell.hxx"
26cdf0e10cSrcweir #include "internal/global.hxx"
27cdf0e10cSrcweir #include "zipexcptn.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir //------------------------------------------
30cdf0e10cSrcweir /**
31cdf0e10cSrcweir */
RuntimeException(int Error)32cdf0e10cSrcweir RuntimeException::RuntimeException(int Error) :
33cdf0e10cSrcweir     m_Error(Error)
34cdf0e10cSrcweir {
35cdf0e10cSrcweir }
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //------------------------------------------
38cdf0e10cSrcweir /**
39cdf0e10cSrcweir */
~RuntimeException()40cdf0e10cSrcweir RuntimeException::~RuntimeException() throw()
41cdf0e10cSrcweir {
42cdf0e10cSrcweir }
43cdf0e10cSrcweir 
44cdf0e10cSrcweir //------------------------------------------
45cdf0e10cSrcweir /**
46cdf0e10cSrcweir */
GetErrorCode() const47cdf0e10cSrcweir int RuntimeException::GetErrorCode() const
48cdf0e10cSrcweir {
49cdf0e10cSrcweir 	return m_Error;
50cdf0e10cSrcweir }
51cdf0e10cSrcweir 
52cdf0e10cSrcweir //------------------------------------------
53cdf0e10cSrcweir /**
54cdf0e10cSrcweir */
ZipException(int Error)55cdf0e10cSrcweir ZipException::ZipException(int Error) :
56cdf0e10cSrcweir 	RuntimeException(Error)
57cdf0e10cSrcweir {
58cdf0e10cSrcweir }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir //------------------------------------------
61cdf0e10cSrcweir /**
62cdf0e10cSrcweir */
what() const63cdf0e10cSrcweir const char* ZipException::what() const throw()
64cdf0e10cSrcweir {
65cdf0e10cSrcweir 	return 0;
66cdf0e10cSrcweir }
67cdf0e10cSrcweir 
68cdf0e10cSrcweir //------------------------------------------
69cdf0e10cSrcweir /**
70cdf0e10cSrcweir */
Win32Exception(int Error)71cdf0e10cSrcweir Win32Exception::Win32Exception(int Error) :
72cdf0e10cSrcweir 	RuntimeException(Error),
73cdf0e10cSrcweir 	m_MsgBuff(0)
74cdf0e10cSrcweir {
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir //------------------------------------------
78cdf0e10cSrcweir /**
79cdf0e10cSrcweir */
~Win32Exception()80cdf0e10cSrcweir Win32Exception::~Win32Exception() throw()
81cdf0e10cSrcweir {
82cdf0e10cSrcweir #ifndef OS2
83cdf0e10cSrcweir 	if (m_MsgBuff)
84cdf0e10cSrcweir 		LocalFree(m_MsgBuff);
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir //------------------------------------------
89cdf0e10cSrcweir /**
90cdf0e10cSrcweir */
what() const91cdf0e10cSrcweir const char* Win32Exception::what() const throw()
92cdf0e10cSrcweir {
93cdf0e10cSrcweir #ifdef OS2
94cdf0e10cSrcweir 	return "Win32Exception!";
95cdf0e10cSrcweir #else
96cdf0e10cSrcweir 	FormatMessage(
97cdf0e10cSrcweir 		FORMAT_MESSAGE_ALLOCATE_BUFFER |
98cdf0e10cSrcweir 		FORMAT_MESSAGE_FROM_SYSTEM |
99cdf0e10cSrcweir 		FORMAT_MESSAGE_IGNORE_INSERTS,
100cdf0e10cSrcweir 		NULL,
101cdf0e10cSrcweir 		GetErrorCode(),
102cdf0e10cSrcweir 		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
103cdf0e10cSrcweir 		(LPTSTR) &m_MsgBuff,
104cdf0e10cSrcweir 		0,
105cdf0e10cSrcweir 		NULL);
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	return reinterpret_cast<char*>(m_MsgBuff);
108cdf0e10cSrcweir #endif
109cdf0e10cSrcweir }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir //------------------------------------------
112cdf0e10cSrcweir /**
113cdf0e10cSrcweir */
ZipContentMissException(int Error)114cdf0e10cSrcweir ZipContentMissException::ZipContentMissException(int Error) :
115cdf0e10cSrcweir 	ZipException(Error)
116cdf0e10cSrcweir {
117cdf0e10cSrcweir }
118cdf0e10cSrcweir 
119cdf0e10cSrcweir //------------------------------------------
120cdf0e10cSrcweir /**
121cdf0e10cSrcweir */
AccessViolationException(int Error)122cdf0e10cSrcweir AccessViolationException::AccessViolationException(int Error) :
123cdf0e10cSrcweir 	Win32Exception(Error)
124cdf0e10cSrcweir {
125cdf0e10cSrcweir }
126cdf0e10cSrcweir 
127cdf0e10cSrcweir //------------------------------------------
128cdf0e10cSrcweir /**
129cdf0e10cSrcweir */
IOException(int Error)130cdf0e10cSrcweir IOException::IOException(int Error) :
131cdf0e10cSrcweir 	Win32Exception(Error)
132cdf0e10cSrcweir {
133cdf0e10cSrcweir }
134