Project

Profile

Help

Download (1.67 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.9 / hec / Saxon.C.API / SaxonApiException.cpp @ 5401a5ae

1 5401a5ae O'Neil Delpratt
// SaxonApiException.cpp : Defines the exported functions for the DLL application.
2
//
3
4
#include "SaxonApiException.h"
5
6
7
8
  const char * SaxonApiException::what () {
9
        return message.c_str();
10
  }
11
12
  SaxonApiException::SaxonApiException(){
13
            message = "";
14
            lineNumber = -1;
15
            errorCode = "";
16
            systemId = "";
17
    }
18
19
20
        SaxonApiException::SaxonApiException(const SaxonApiException &ex){
21
                message = ex.message;
22
                lineNumber = ex.lineNumber;
23
                errorCode = ex.errorCode;
24
                systemId = ex.systemId;
25
        }
26
27
28
        SaxonApiException::SaxonApiException(const char * m, const char * ec, const char * sysId, int linenumber){
29
                if(m != NULL) {
30
                    message = std::string(m);
31
                } else {
32
                    message = "";
33
                }
34
35
        lineNumber = linenumber;
36
37
        if (ec != NULL) {
38
            errorCode = std::string(ec);
39
        } else {
40
            errorCode = "";
41
        }
42
43
        if(sysId != NULL) {
44
            systemId = sysId;
45
        } else {
46
            systemId = "";
47
        }
48
        }
49
50
51
52
53
    /**
54
     * A destructor.
55
     */
56
        SaxonApiException::~SaxonApiException() throw {
57
        message.clear();
58
        errorCode.clear();
59
        systemId.clear();
60
        }
61
62
    /**
63
     * Get the error code associated with the ith exception in the vector, if there is one
64
     * @param i - ith exception in the vector
65
     * @return the associated error code, or null if no error code is available
66
     */
67
        const char * SaxonApiException::getErrorCode(){
68
                return errorCode.c_str();
69
        }
70
71
72
        int SaxonApiException::getLineNumber(){
73
        return lineNumber;
74
        }
75
76
77
    const char * SaxonApiException::getSystemId() {
78
        return systemId.c_str();
79
    }
80
81
        const char * SaxonApiException::getMessage(){
82
            return message.c_str();
83
84
        }