1 | /*
|
---|
2 | * Copyright 1999-2000,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: OutOfMemoryException.hpp,v 1.3 2004/09/08 13:56:22 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #if !defined(OUT_OF_MEMORY_EXCEPTION_HPP)
|
---|
22 | #define OUT_OF_MEMORY_EXCEPTION_HPP
|
---|
23 |
|
---|
24 | #include <xercesc/util/XMemory.hpp>
|
---|
25 | #include <xercesc/util/XMLExceptMsgs.hpp>
|
---|
26 | #include <xercesc/util/XMLUniDefs.hpp>
|
---|
27 |
|
---|
28 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
29 |
|
---|
30 | const XMLCh gDefOutOfMemoryErrMsg[] =
|
---|
31 | {
|
---|
32 | chLatin_O, chLatin_u, chLatin_t, chLatin_O
|
---|
33 | , chLatin_f, chLatin_M, chLatin_e, chLatin_m
|
---|
34 | , chLatin_o, chLatin_r, chLatin_y, chNull
|
---|
35 | };
|
---|
36 |
|
---|
37 | class XMLUTIL_EXPORT OutOfMemoryException : public XMemory
|
---|
38 | {
|
---|
39 | public:
|
---|
40 |
|
---|
41 | OutOfMemoryException();
|
---|
42 | ~OutOfMemoryException();
|
---|
43 | // -----------------------------------------------------------------------
|
---|
44 | // Getter methods
|
---|
45 | // -----------------------------------------------------------------------
|
---|
46 | XMLExcepts::Codes getCode() const;
|
---|
47 | const XMLCh* getMessage() const;
|
---|
48 | const XMLCh* getType() const;
|
---|
49 | const char* getSrcFile() const;
|
---|
50 | unsigned int getSrcLine() const;
|
---|
51 |
|
---|
52 | OutOfMemoryException(const OutOfMemoryException& toCopy);
|
---|
53 | OutOfMemoryException& operator=(const OutOfMemoryException& toAssign);
|
---|
54 | };
|
---|
55 |
|
---|
56 | // constructors/destructors...
|
---|
57 | inline OutOfMemoryException::OutOfMemoryException() {}
|
---|
58 | inline OutOfMemoryException::~OutOfMemoryException() {}
|
---|
59 | inline OutOfMemoryException::OutOfMemoryException(const OutOfMemoryException&) {}
|
---|
60 | inline OutOfMemoryException& OutOfMemoryException::operator=(const OutOfMemoryException&)
|
---|
61 | {
|
---|
62 | return *this;
|
---|
63 | }
|
---|
64 |
|
---|
65 | // ---------------------------------------------------------------------------
|
---|
66 | // OutOfMemoryException: Getter methods
|
---|
67 | // ---------------------------------------------------------------------------
|
---|
68 | inline XMLExcepts::Codes OutOfMemoryException::getCode() const
|
---|
69 | {
|
---|
70 | return XMLExcepts::Out_Of_Memory;
|
---|
71 | }
|
---|
72 |
|
---|
73 | inline const XMLCh* OutOfMemoryException::getMessage() const
|
---|
74 | {
|
---|
75 | return gDefOutOfMemoryErrMsg;
|
---|
76 | }
|
---|
77 |
|
---|
78 | inline const XMLCh* OutOfMemoryException::getType() const
|
---|
79 | {
|
---|
80 | return gDefOutOfMemoryErrMsg;
|
---|
81 | }
|
---|
82 |
|
---|
83 | inline const char* OutOfMemoryException::getSrcFile() const
|
---|
84 | {
|
---|
85 | return "";
|
---|
86 | }
|
---|
87 |
|
---|
88 | inline unsigned int OutOfMemoryException::getSrcLine() const {
|
---|
89 | return 0;
|
---|
90 | }
|
---|
91 |
|
---|
92 | XERCES_CPP_NAMESPACE_END
|
---|
93 |
|
---|
94 | #endif
|
---|