MCPcopy Create free account
hub / github.com/KDE/okular / parseGUID

Function parseGUID

generators/xps/generator_xps.cpp:85–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85static bool parseGUID(const QString &guidString, unsigned short guid[16])
86{
87 if (guidString.length() <= 35) {
88 return false;
89 }
90
91 // Maps bytes to positions in guidString
92 const static int indexes[] = {6, 4, 2, 0, 11, 9, 16, 14, 19, 21, 24, 26, 28, 30, 32, 34};
93
94 for (int i = 0; i < 16; i++) {
95 int hex1 = hex2int(guidString[indexes[i]].cell());
96 int hex2 = hex2int(guidString[indexes[i] + 1].cell());
97
98 if ((hex1 < 0) || (hex2 < 0)) {
99 return false;
100 }
101
102 guid[i] = hex1 * 16 + hex2;
103 }
104
105 return true;
106}
107
108// Read next token of abbreviated path data
109static bool nextAbbPathToken(AbbPathToken *token)

Callers 1

loadFontByNameMethod · 0.85

Calls 1

hex2intFunction · 0.85

Tested by

no test coverage detected