1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * comtypes.cpp --
|
---|
4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
5 | *
|
---|
6 | * PUT COPYRIGHT NOTICE HERE
|
---|
7 | *
|
---|
8 | * $Id: comtypes.cpp 197 1999-03-09 21:00:48Z rjmcnab $
|
---|
9 | *
|
---|
10 | *********************************************************************/
|
---|
11 |
|
---|
12 | /*
|
---|
13 | $Log$
|
---|
14 | Revision 1.3 1999/03/09 21:00:47 rjmcnab
|
---|
15 | Reorganised the statusaction, added more functions to comtypes.
|
---|
16 |
|
---|
17 | Revision 1.2 1999/03/04 21:19:15 rjmcnab
|
---|
18 |
|
---|
19 | Added clear() functions to all the data types.
|
---|
20 |
|
---|
21 | Revision 1.1 1999/02/21 22:35:25 rjmcnab
|
---|
22 |
|
---|
23 | Initial revision.
|
---|
24 |
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | #include "comtypes.h"
|
---|
29 |
|
---|
30 |
|
---|
31 | void ShortColInfo_t::clear() {
|
---|
32 | name.clear();
|
---|
33 | host.clear();
|
---|
34 | port = 0;
|
---|
35 | }
|
---|
36 |
|
---|
37 | void ColInfoResponse_t::clear () {
|
---|
38 | shortInfo.clear();
|
---|
39 | isPublic=false;
|
---|
40 | isBeta=false;
|
---|
41 | buildDate=0;
|
---|
42 | numDocs=0;
|
---|
43 | numWords=0;
|
---|
44 | numBytes=0;
|
---|
45 | }
|
---|
46 |
|
---|
47 | void FilterOption_t::clear () {
|
---|
48 | name.clear();
|
---|
49 | type = booleant;
|
---|
50 | repeatable = onePerQuery;
|
---|
51 | defaultValue.clear();
|
---|
52 | validValues.erase(validValues.begin(), validValues.end());
|
---|
53 | }
|
---|
54 |
|
---|
55 | void FilterOption_t::check_defaultValue () {
|
---|
56 | if (validValues.empty()) {
|
---|
57 | // nothing to check against
|
---|
58 | defaultValue.clear();
|
---|
59 | return;
|
---|
60 | }
|
---|
61 |
|
---|
62 | text_tarray::iterator here = validValues.begin ();
|
---|
63 | text_tarray::iterator end = validValues.end ();
|
---|
64 | while (here != end) {
|
---|
65 | if (*here == defaultValue) {
|
---|
66 | // found the default value in the list of valid values
|
---|
67 | // now there is nothing more to do
|
---|
68 | return;
|
---|
69 | }
|
---|
70 |
|
---|
71 | here++;
|
---|
72 | }
|
---|
73 |
|
---|
74 | // did not find the defaultValue, set it to be the
|
---|
75 | // first option in the list
|
---|
76 | defaultValue = validValues[0];
|
---|
77 | }
|
---|
78 |
|
---|
79 | void FilterDescript_t::clear () {
|
---|
80 | filterName.clear();
|
---|
81 | filterOptions.erase(filterOptions.begin(), filterOptions.end());
|
---|
82 | }
|
---|
83 |
|
---|
84 | void InfoFilterOptionsResponse_t::clear () {
|
---|
85 | filterOptions.erase(filterOptions.begin(), filterOptions.end());
|
---|
86 | }
|
---|
87 |
|
---|
88 | void OptionValue_t::clear () {
|
---|
89 | name.clear();
|
---|
90 | value.clear();
|
---|
91 | }
|
---|
92 |
|
---|
93 | void FilterRequest_t::clear () {
|
---|
94 | filterName.clear();
|
---|
95 | filterOptions.erase(filterOptions.begin(), filterOptions.end());
|
---|
96 | docSet.erase(docSet.begin(), docSet.end());
|
---|
97 | filterResultOptions = 0;
|
---|
98 | }
|
---|
99 |
|
---|
100 | void TermInfo_t::clear () {
|
---|
101 | term.clear();
|
---|
102 | freq = 0;
|
---|
103 | matchTerms.erase (matchTerms.begin(), matchTerms.end());
|
---|
104 | }
|
---|
105 |
|
---|
106 |
|
---|
107 | void ResultDocInfo_t::clear () {
|
---|
108 | OID.clear ();
|
---|
109 | subCol.erase (subCol.begin(), subCol.end());
|
---|
110 | ranking = 0.0;
|
---|
111 | docFreq.erase(docFreq.begin(), docFreq.end());
|
---|
112 | }
|
---|
113 |
|
---|
114 | ResultDocInfo_t &ResultDocInfo_t::operator=(const ResultDocInfo_t &x) {
|
---|
115 | OID=x.OID;
|
---|
116 | subCol=x.subCol;
|
---|
117 | ranking=x.ranking;
|
---|
118 | docFreq=x.docFreq;
|
---|
119 | return *this;
|
---|
120 | }
|
---|
121 |
|
---|
122 |
|
---|
123 | void FilterResponse_t::clear () {
|
---|
124 | docsFound = 0;
|
---|
125 | isApprox = false;
|
---|
126 | termInfo.erase (termInfo.begin(), termInfo.end());
|
---|
127 | docInfo.erase (docInfo.begin(), docInfo.end());
|
---|
128 | }
|
---|
129 |
|
---|
130 | void MetadataInfoResponse_t::clear () {
|
---|
131 | supportedFields.erase (supportedFields.begin(), supportedFields.end());
|
---|
132 | supportedLanguages.erase (supportedLanguages.begin(), supportedLanguages.end());
|
---|
133 | }
|
---|
134 |
|
---|
135 | void MetadataRequest_t::clear () {
|
---|
136 | OIDs.erase (OIDs.begin(), OIDs.end());
|
---|
137 | fields.erase (fields.begin(), fields.end());
|
---|
138 | languages.erase (languages.begin(), languages.end());
|
---|
139 | }
|
---|
140 |
|
---|
141 | void MetadataResponse_t::clear () {
|
---|
142 | metadata.erase (metadata.begin(), metadata.end());
|
---|
143 | };
|
---|
144 |
|
---|