Tue, 14 Feb 2017 08:33:44 +0200
Moved more stuff to GLCamera
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
1072 | 3 | * Copyright (C) 2013 - 2017 Teemu Piippo |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
946 | 19 | #include <QFile> |
998 | 20 | #include <QMessageBox> |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | #include "colors.h" |
1012 | 22 | #include "ldpaths.h" |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | |
1114
ffd49a28f49e
Moved some global constants into appropriate namespaces.
Teemu Piippo <teemu@hecknology.net>
parents:
1086
diff
changeset
|
24 | ColorData* LDColor::colorData = nullptr; |
ffd49a28f49e
Moved some global constants into appropriate namespaces.
Teemu Piippo <teemu@hecknology.net>
parents:
1086
diff
changeset
|
25 | const LDColor LDColor::nullColor {-1}; |
946 | 26 | |
1044 | 27 | /* |
28 | * initColors | |
29 | * | |
30 | * Initializes the color information module. | |
31 | */ | |
1114
ffd49a28f49e
Moved some global constants into appropriate namespaces.
Teemu Piippo <teemu@hecknology.net>
parents:
1086
diff
changeset
|
32 | void LDColor::initColors() |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | print ("Initializing color information.\n"); |
998 | 35 | static ColorData colors; |
1114
ffd49a28f49e
Moved some global constants into appropriate namespaces.
Teemu Piippo <teemu@hecknology.net>
parents:
1086
diff
changeset
|
36 | LDColor::colorData = &colors; |
946 | 37 | } |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | |
1044 | 39 | /* |
40 | * LDColor :: LDColor | |
41 | * | |
42 | * Default-constructs an LDColor to 0 (black). | |
43 | */ | |
44 | LDColor::LDColor() : | |
45 | m_index (0) {} | |
46 | ||
47 | /* | |
48 | * LDColor :: LDColor | |
49 | * | |
50 | * Constructs an LDColor by index. | |
51 | */ | |
52 | LDColor::LDColor (qint32 index) | |
53 | : m_index (index) {} | |
54 | ||
55 | /* | |
56 | * LDColor :: isValid | |
57 | * | |
58 | * Returns whether or not the color is valid. | |
59 | */ | |
946 | 60 | bool LDColor::isValid() const |
61 | { | |
998 | 62 | if (isLDConfigColor() and data().name.isEmpty()) |
946 | 63 | return false; // Unknown LDConfig color |
1044 | 64 | else |
65 | return m_index != -1; | |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
66 | } |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | |
1044 | 68 | /* |
69 | * LDColor :: isLDConfigColor | |
70 | * | |
71 | * Returns whether or not this color is defined in LDConfig.ldr. | |
72 | * This is false for e.g. direct colors. | |
73 | */ | |
946 | 74 | bool LDColor::isLDConfigColor() const |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
75 | { |
1044 | 76 | return colorData->contains(index()); |
998 | 77 | } |
78 | ||
1044 | 79 | /* |
80 | * LDColor :: data | |
81 | * | |
82 | * Returns the ColorData entry for this color. | |
83 | */ | |
998 | 84 | const ColorData::Entry& LDColor::data() const |
85 | { | |
1044 | 86 | return colorData->get(index()); |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
87 | } |
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
88 | |
1044 | 89 | /* |
90 | * LDColor :: name | |
91 | * | |
92 | * Returns the name of this color. | |
93 | */ | |
946 | 94 | QString LDColor::name() const |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
95 | { |
946 | 96 | if (isDirect()) |
97 | return "0x" + QString::number (index(), 16).toUpper(); | |
98 | else if (isLDConfigColor()) | |
998 | 99 | return data().name; |
946 | 100 | else if (index() == -1) |
101 | return "null color"; | |
102 | else | |
1044 | 103 | return "unknown"; |
946 | 104 | } |
105 | ||
1044 | 106 | /* |
107 | * LDColor :: hexcode | |
108 | * | |
109 | * Returns the hexadecimal code of this color. | |
110 | */ | |
946 | 111 | QString LDColor::hexcode() const |
112 | { | |
113 | return faceColor().name(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
114 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
115 | |
1044 | 116 | /* |
117 | * LDColor :: faceColor | |
118 | * | |
119 | * Returns the color used for surfaces. | |
120 | */ | |
946 | 121 | QColor LDColor::faceColor() const |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | { |
946 | 123 | if (isDirect()) |
124 | { | |
1044 | 125 | // Direct color -- compute from the index. |
946 | 126 | QColor color; |
1044 | 127 | color.setRed((index() & 0x0FF0000) >> 16); |
128 | color.setGreen((index() & 0x000FF00) >> 8); | |
129 | color.setBlue(index() & 0x00000FF); | |
946 | 130 | |
131 | if (index() >= 0x3000000) | |
1044 | 132 | color.setAlpha(128); |
946 | 133 | |
134 | return color; | |
135 | } | |
136 | else if (isLDConfigColor()) | |
137 | { | |
998 | 138 | return data().faceColor; |
946 | 139 | } |
140 | else | |
141 | { | |
142 | return Qt::black; | |
143 | } | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
144 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
145 | |
1044 | 146 | /* |
147 | * LDColor :: edgeColor | |
148 | * | |
149 | * Returns the color used for edge lines. | |
150 | */ | |
946 | 151 | QColor LDColor::edgeColor() const |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
152 | { |
946 | 153 | if (isDirect()) |
1044 | 154 | return luma(faceColor()) < 48 ? Qt::white : Qt::black; |
946 | 155 | else if (isLDConfigColor()) |
998 | 156 | return data().edgeColor; |
946 | 157 | else |
158 | return Qt::black; | |
159 | } | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
160 | |
1044 | 161 | /* |
162 | * LDColor :: index | |
163 | * | |
164 | * Returns the index number of this color. | |
165 | */ | |
946 | 166 | qint32 LDColor::index() const |
167 | { | |
168 | return m_index; | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
169 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
170 | |
1044 | 171 | /* |
172 | * LDColor :: indexString | |
173 | * | |
174 | * Returns a string containing the preferred representation of the index. | |
175 | */ | |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
176 | QString LDColor::indexString() const |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
177 | { |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
178 | if (isDirect()) |
1044 | 179 | { |
180 | // Use hexadecimal notation for direct colors. | |
181 | return "0x" + QString::number(index(), 16).toUpper(); | |
182 | } | |
183 | else | |
184 | { | |
185 | return QString::number(index()); | |
186 | } | |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
187 | } |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
188 | |
1044 | 189 | /* |
190 | * LDColor :: isDirect | |
191 | * | |
192 | * Returns whether or not this color is a direct color. | |
193 | * Direct colors are picked by RGB value and are not defined in LDConfig.ldr. | |
194 | */ | |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
195 | bool LDColor::isDirect() const |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
196 | { |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
197 | return index() >= 0x02000000; |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
198 | } |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
797
diff
changeset
|
199 | |
1044 | 200 | /* |
201 | * qHash | |
202 | * | |
203 | * LDColors are hashed by their index. | |
204 | */ | |
1031
55c0d3beea0d
removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
205 | uint qHash(LDColor color) |
55c0d3beea0d
removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
206 | { |
55c0d3beea0d
removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
207 | return color.index(); |
55c0d3beea0d
removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
208 | } |
55c0d3beea0d
removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents:
1014
diff
changeset
|
209 | |
1044 | 210 | /* |
211 | * luma | |
212 | * | |
213 | * Calculates the luma-value for the given color. | |
214 | * c.f. https://en.wikipedia.org/wiki/Luma_(video) | |
215 | */ | |
216 | int luma (const QColor& color) | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
217 | { |
1044 | 218 | return round((0.2126 * color.red()) + (0.7152 * color.green()) + (0.0722 * color.blue())); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
219 | } |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
220 | |
1044 | 221 | /* |
222 | * ColorData :: ColorData | |
223 | * | |
224 | * Constructs the color data array. | |
225 | */ | |
998 | 226 | ColorData::ColorData() |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
706
diff
changeset
|
227 | { |
998 | 228 | // Initialize main and edge colors, they're special like that. |
1044 | 229 | m_data[MainColor].faceColor = "#AAAAAA"; |
998 | 230 | m_data[MainColor].edgeColor = Qt::black; |
231 | m_data[MainColor].name = "Main color"; | |
232 | m_data[EdgeColor].faceColor = | |
1044 | 233 | m_data[EdgeColor].edgeColor = "#000000"; |
998 | 234 | m_data[EdgeColor].name = "Edge color"; |
1044 | 235 | |
236 | // Load the rest from LDConfig.ldr. | |
998 | 237 | loadFromLdconfig(); |
238 | } | |
239 | ||
1044 | 240 | /* |
241 | * ColorData :: contains | |
242 | * | |
243 | * Returns whether or not the given color index is present in the array. | |
244 | */ | |
245 | bool ColorData::contains(int code) const | |
946 | 246 | { |
1065
c8ecddbd99e9
Actually, let's call it countof(). Makes more sense.
Teemu Piippo <teemu@hecknology.net>
parents:
1063
diff
changeset
|
247 | return code >= 0 and code < countof(m_data); |
998 | 248 | } |
249 | ||
1044 | 250 | /* |
251 | * ColorData :: get | |
252 | * | |
253 | * Returns an entry in the color array. | |
254 | */ | |
255 | const ColorData::Entry& ColorData::get(int code) const | |
998 | 256 | { |
1044 | 257 | if (not contains(code)) |
258 | throw std::runtime_error {"Attempted to get non-existant color information"}; | |
946 | 259 | |
998 | 260 | return m_data[code]; |
261 | } | |
262 | ||
1044 | 263 | /* |
264 | * ColorData :: loadFromLdconfig | |
265 | * | |
266 | * Loads color information from LDConfig.ldr. | |
267 | */ | |
998 | 268 | void ColorData::loadFromLdconfig() |
269 | { | |
1012 | 270 | QString path = LDPaths::ldConfigPath(); |
1044 | 271 | QFile file {path}; |
998 | 272 | |
1044 | 273 | if (not file.open (QIODevice::ReadOnly)) |
946 | 274 | { |
1044 | 275 | QMessageBox::critical(nullptr, "Error", "Unable to open LDConfig.ldr for parsing: " + file.errorString()); |
946 | 276 | return; |
277 | } | |
278 | ||
998 | 279 | // TODO: maybe LDConfig can be loaded as a Document? Or would that be overkill? |
1044 | 280 | while (not file.atEnd()) |
946 | 281 | { |
1044 | 282 | QString line = QString::fromUtf8 (file.readLine()); |
946 | 283 | |
284 | if (line.isEmpty() or line[0] != '0') | |
285 | continue; // empty or illogical | |
286 | ||
1044 | 287 | line.remove('\r'); |
288 | line.remove('\n'); | |
946 | 289 | |
290 | // Parse the line | |
1044 | 291 | LDConfigParser parser = {line}; |
998 | 292 | QString name; |
293 | QString facename; | |
294 | QString edgename; | |
295 | QString codestring; | |
946 | 296 | |
297 | // Check 0 !COLOUR, parse the name | |
1044 | 298 | if (not parser.compareToken(0, "0") or not parser.compareToken(1, "!COLOUR") or not parser.getToken(name, 2)) |
946 | 299 | continue; |
300 | ||
301 | // Replace underscores in the name with spaces for readability | |
1044 | 302 | name.replace("_", " "); |
946 | 303 | |
998 | 304 | if (not parser.parseTag ("CODE", codestring)) |
946 | 305 | continue; |
306 | ||
307 | bool ok; | |
1044 | 308 | int code = codestring.toShort(&ok); |
946 | 309 | |
1044 | 310 | if (not ok or not contains(code)) |
946 | 311 | continue; |
312 | ||
1044 | 313 | if (not parser.parseTag("VALUE", facename) or not parser.parseTag("EDGE", edgename)) |
946 | 314 | continue; |
315 | ||
316 | // Ensure that our colors are correct | |
1044 | 317 | QColor faceColor = {facename}; |
318 | QColor edgeColor = {edgename}; | |
946 | 319 | |
320 | if (not faceColor.isValid() or not edgeColor.isValid()) | |
321 | continue; | |
322 | ||
1044 | 323 | // Fill in the entry now. |
998 | 324 | Entry& entry = m_data[code]; |
946 | 325 | entry.name = name; |
326 | entry.faceColor = faceColor; | |
327 | entry.edgeColor = edgeColor; | |
998 | 328 | |
1044 | 329 | // If the alpha tag is present, fill in that too. |
330 | if (parser.parseTag("ALPHA", codestring)) | |
331 | entry.faceColor.setAlpha(qBound(0, codestring.toInt(), 255)); | |
946 | 332 | } |
333 | } | |
334 | ||
1044 | 335 | /* |
336 | * LDConfigParser :: LDConfigParser | |
337 | * | |
338 | * Constructs the LDConfig.ldr parser. | |
339 | */ | |
340 | LDConfigParser::LDConfigParser(QString inputText) | |
946 | 341 | { |
1044 | 342 | m_tokens = inputText.split (' ', QString::SkipEmptyParts); |
946 | 343 | } |
344 | ||
1044 | 345 | /* |
346 | * LDConfigParser :: getToken | |
347 | * | |
348 | * Returns whether or not there is a token at the given position. | |
349 | * If there is, fills in the value parameter with it. | |
350 | */ | |
351 | bool LDConfigParser::getToken(QString& tokenText, int position) | |
946 | 352 | { |
1065
c8ecddbd99e9
Actually, let's call it countof(). Makes more sense.
Teemu Piippo <teemu@hecknology.net>
parents:
1063
diff
changeset
|
353 | if (position >= countof(m_tokens)) |
1044 | 354 | { |
946 | 355 | return false; |
1044 | 356 | } |
357 | else | |
358 | { | |
359 | tokenText = m_tokens[position]; | |
360 | return true; | |
361 | } | |
946 | 362 | } |
363 | ||
1044 | 364 | /* |
365 | * LDConfigParser :: findToken | |
366 | * | |
367 | * Attempts to find the provided token in the parsed LDConfig.ldr line. | |
368 | * If found, fills in the first parameter with the position of the token. | |
369 | * | |
370 | * The args parameter specifies how many arguments (i.e. following tokens) the token needs to have. | |
371 | */ | |
372 | bool LDConfigParser::findToken(int& tokenPosition, QString needle, int args) | |
946 | 373 | { |
1065
c8ecddbd99e9
Actually, let's call it countof(). Makes more sense.
Teemu Piippo <teemu@hecknology.net>
parents:
1063
diff
changeset
|
374 | for (int i = 0; i < (countof(m_tokens) - args); ++i) |
946 | 375 | { |
376 | if (m_tokens[i] == needle) | |
377 | { | |
1044 | 378 | tokenPosition = i; |
946 | 379 | return true; |
380 | } | |
381 | } | |
382 | ||
383 | return false; | |
384 | } | |
385 | ||
1044 | 386 | /* |
387 | * LDConfigParser :: compareToken | |
388 | * | |
389 | * Returns whether or not the token at the given position has the given text value. | |
390 | */ | |
391 | bool LDConfigParser::compareToken (int position, QString text) | |
946 | 392 | { |
1044 | 393 | QString token; |
946 | 394 | |
1044 | 395 | if (not getToken(token, position)) |
946 | 396 | return false; |
1044 | 397 | else |
398 | return (token == text); | |
946 | 399 | } |
400 | ||
1044 | 401 | /* |
402 | * LDConfig :: parseTag | |
403 | * | |
404 | * Finds an attribute in the line, and fills in its value. | |
405 | * For instance, if the line contains "ALPHA 128", this function can find the "128" for "ALPHA". | |
406 | * Returns whether or not the attribute was found. | |
407 | */ | |
408 | bool LDConfigParser::parseTag (QString key, QString& value) | |
946 | 409 | { |
1044 | 410 | int position; |
946 | 411 | |
412 | // Try find the token and get its position | |
1044 | 413 | if (not findToken (position, key, 1)) |
414 | { | |
946 | 415 | return false; |
1044 | 416 | } |
417 | else | |
418 | { | |
419 | // Get the token after it and store it in. | |
420 | return getToken (value, position + 1); | |
421 | } | |
422 | } |