Qt 4.8
Enumerations | Functions
qsvgstructure.cpp File Reference
#include "qsvgstructure_p.h"
#include "qsvgnode_p.h"
#include "qsvgstyle_p.h"
#include "qsvgtinydocument_p.h"
#include "qpainter.h"
#include "qlocale.h"
#include "qdebug.h"

Go to the source code of this file.

Enumerations

enum  {
  TOTAL_KEYWORDS = 20, MIN_WORD_LENGTH = 47, MAX_WORD_LENGTH = 78, MIN_HASH_VALUE = 48,
  MAX_HASH_VALUE = 88
}
 

Functions

static bool isSupportedSvgExtension (const QString &)
 
static bool isSupportedSvgFeature (const QString &str)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TOTAL_KEYWORDS 
MIN_WORD_LENGTH 
MAX_WORD_LENGTH 
MIN_HASH_VALUE 
MAX_HASH_VALUE 

Definition at line 183 of file qsvgstructure.cpp.

Function Documentation

◆ isSupportedSvgExtension()

static bool isSupportedSvgExtension ( const QString )
inlinestatic

Definition at line 271 of file qsvgstructure.cpp.

Referenced by QSvgSwitch::draw().

272 {
273  return false;
274 }

◆ isSupportedSvgFeature()

static bool isSupportedSvgFeature ( const QString str)
inlinestatic

Definition at line 192 of file qsvgstructure.cpp.

Referenced by QSvgSwitch::draw().

193 {
194  static const unsigned char asso_values[] = {
195  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
196  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
197  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
198  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
199  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
200  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
201  89, 89, 89, 89, 89, 89, 89, 0, 89, 5,
202  15, 5, 0, 10, 89, 89, 89, 89, 89, 0,
203  15, 89, 89, 0, 0, 89, 5, 89, 0, 89,
204  89, 89, 89, 89, 89, 89, 89, 0, 89, 89,
205  89, 0, 89, 89, 0, 89, 89, 89, 0, 5,
206  89, 0, 0, 89, 5, 89, 0, 89, 89, 89,
207  5, 0, 89, 89, 89, 89, 89, 89, 89, 89,
208  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
209  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
210  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
211  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
212  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
213  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
214  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
215  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
216  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
217  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
218  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
219  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
220  89, 89, 89, 89, 89, 89
221  };
222 
223  static const char * wordlist[] = {
224  "", "", "", "", "", "", "", "", "",
225  "", "", "", "", "", "", "", "", "",
226  "", "", "", "", "", "", "", "", "",
227  "", "", "", "", "", "", "", "", "",
228  "", "", "", "", "", "", "", "", "",
229  "", "", "",
230  "http://www.w3.org/Graphics/SVG/feature/1.2/#Text",
231  "http://www.w3.org/Graphics/SVG/feature/1.2/#Shape",
232  "", "",
233  "http://www.w3.org/Graphics/SVG/feature/1.2/#SVG",
234  "http://www.w3.org/Graphics/SVG/feature/1.2/#Structure",
235  "http://www.w3.org/Graphics/SVG/feature/1.2/#SolidColor",
236  "",
237  "http://www.w3.org/Graphics/SVG/feature/1.2/#Hyperlinking",
238  "http://www.w3.org/Graphics/SVG/feature/1.2/#CoreAttribute",
239  "http://www.w3.org/Graphics/SVG/feature/1.2/#XlinkAttribute",
240  "http://www.w3.org/Graphics/SVG/feature/1.2/#SVG-static",
241  "http://www.w3.org/Graphics/SVG/feature/1.2/#OpacityAttribute",
242  "",
243  "http://www.w3.org/Graphics/SVG/feature/1.2/#Gradient",
244  "http://www.w3.org/Graphics/SVG/feature/1.2/#Font",
245  "http://www.w3.org/Graphics/SVG/feature/1.2/#Image",
246  "http://www.w3.org/Graphics/SVG/feature/1.2/#ConditionalProcessing",
247  "",
248  "http://www.w3.org/Graphics/SVG/feature/1.2/#Extensibility",
249  "", "", "",
250  "http://www.w3.org/Graphics/SVG/feature/1.2/#GraphicsAttribute",
251  "http://www.w3.org/Graphics/SVG/feature/1.2/#Prefetch",
252  "http://www.w3.org/Graphics/SVG/feature/1.2/#PaintAttribute",
253  "http://www.w3.org/Graphics/SVG/feature/1.2/#ConditionalProcessingAttribute",
254  "", "", "", "", "", "", "", "", "",
255  "", "", "", "",
256  "http://www.w3.org/Graphics/SVG/feature/1.2/#ExternalResourcesRequiredAttribute"
257  };
258 
259  if (str.length() <= MAX_WORD_LENGTH && str.length() >= MIN_WORD_LENGTH) {
260  const int key = str.length()
261  + asso_values[str.at(45).unicode()]
262  + asso_values[str.at(44).unicode()];
263  if (key <= MAX_HASH_VALUE && key >= 0)
264  return str == QLatin1String(wordlist[key]);
265  }
266  return false;
267 }
const QChar at(int i) const
Returns the character at the given index position in the string.
Definition: qstring.h:698
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int key