BiblioteQ: Source/biblioteq_marc.h Source File

BiblioteQ

biblioteq_marc.h
1 /*
2 ** Copyright (c) 2006 - present, Alexis Megas.
3 ** All rights reserved.
4 **
5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions
7 ** are met:
8 ** 1. Redistributions of source code must retain the above copyright
9 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
13 ** 3. The name of the author may not be used to endorse or promote products
14 ** derived from BiblioteQ without specific prior written permission.
15 **
16 ** BIBLIOTEQ IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 ** BIBLIOTEQ, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 #ifndef _BIBLIOTEQ_MARC_H_
29 #define _BIBLIOTEQ_MARC_H_
30
31 #include <QDate>
32
33 class biblioteq_marc
34 {
35 public:
36 enum ITEM_TYPE
37 {
38 BOOK = 0,
39 MAGAZINE
40 };
41
42 enum PROTOCOL
43 {
44 SRU = 0,
45 Z3950
46 };
47
48 enum RECORD_SYNTAX
49 {
50 MARC21 = 0,
51 UNIMARC
52 };
53
54 biblioteq_marc(const ITEM_TYPE itemType,
55 const PROTOCOL protocol,
56 const RECORD_SYNTAX recordSyntax);
57 biblioteq_marc(void);
58 ~biblioteq_marc();
59
60 QDate publicationDate(void) const
61 {
62 return m_publicationDate;
63 }
64
65 QString author(void) const
66 {
67 return m_author.trimmed();
68 }
69
70 QString binding(void) const
71 {
72 return m_binding.trimmed();
73 }
74
75 QString callnum(void) const
76 {
77 return m_callnum.trimmed();
78 }
79
80 QString category(void) const
81 {
82 return m_category.trimmed();
83 }
84
85 QString description(void) const
86 {
87 return m_description.trimmed();
88 }
89
90 QString deweynum(void) const
91 {
92 return m_deweynum.trimmed();
93 }
94
95 QString edition(void) const
96 {
97 return m_edition.trimmed();
98 }
99
100 QString isbn10(void) const
101 {
102 return m_isbn10.trimmed();
103 }
104
105 QString isbn13(void) const
106 {
107 return m_isbn13.trimmed();
108 }
109
110 QString lcnum(void) const
111 {
112 return m_lcnum.trimmed();
113 }
114
115 QString place(void) const
116 {
117 return m_place.trimmed();
118 }
119
120 QString publisher(void) const
121 {
122 return m_publisher.trimmed();
123 }
124
125 QString sru003(void) const
126 {
127 return m_sru003;
128 }
129
130 QString targetAudience(void) const
131 {
132 return m_targetAudience;
133 }
134
135 QString title(void) const
136 {
137 return m_title.trimmed();
138 }
139
140 QString volumeNumber(void) const
141 {
142 return m_volumeNumber.trimmed();
143 }
144
145 void initialize(const ITEM_TYPE itemType,
146 const PROTOCOL protocol,
147 const RECORD_SYNTAX recordSyntax);
148 void parse(const QString &data);
149
150 private:
151 ITEM_TYPE m_itemType;
152 PROTOCOL m_protocol;
153 QDate m_publicationDate;
154 QString m_author;
155 QString m_binding;
156 QString m_callnum;
157 QString m_category;
158 QString m_data;
159 QString m_description;
160 QString m_deweynum;
161 QString m_edition;
162 QString m_isbn10;
163 QString m_isbn13;
164 QString m_lcnum;
165 QString m_place;
166 QString m_publisher;
167 QString m_sru003;
168 QString m_targetAudience;
169 QString m_title;
170 QString m_volumeNumber;
171 RECORD_SYNTAX m_recordSyntax;
172 void clear(void);
173 void parseBookSRUMarc21(void);
174 void parseBookSRUUnimarc(void);
175 void parseBookZ3950Marc21(void);
176 void parseBookZ3950Unimarc(void);
177 void parseMagazineZ3950Marc21(void);
178 void parseMagazineZ3950Unimarc(void);
179 void parseSRU(void);
180 void parseZ3950(void);
181 };
182
183 #endif
biblioteq_marc
Definition: biblioteq_marc.h:34