• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Sonnet

  • sonnet
  • unicode
  • parseucd
parseucd.cpp
Go to the documentation of this file.
1
22#include <QtCore/QDebug>
23#include <QtCore/QFile>
24#include <QtCore/QHash>
25#include <QtCore/QRegExp>
26#include <QtCore/QString>
27#include <QtCore/QStringList>
28#include <QtCore/QTextStream>
29
30int main()
31{
32 QString str;
33 QTextStream in(stdin);
34
35 QFile sout;
36 sout.open(stdout, QIODevice::WriteOnly);
37 QDataStream out(&sout);
38
39 bool ok = true, ok2;
40 QHash<quint32,quint8> data;
41 QHash<qint8,QString> catalog;
42
43 while ( ok )
44 {
45 QString line = in.readLine();
46 ok = !in.atEnd();
47
48 if ( line.isEmpty() || line.startsWith('#') )
49 continue;
50
51 QRegExp rx(";");
52 int split = rx.indexIn(line);
53
54 QString catagoryString = line.right( line.size() - split - 1 ).simplified();
55
56 qint8 catagory = catalog.key(catagoryString);
57 if(!catagory)
58 {
59 catalog[ catagory = catalog.size()+1 ] = catagoryString;
60 }
61
62 QString codes = line.left( split ).simplified();
63 QStringList codeList = codes.split ( ".." );
64
65 quint32 start = codeList.at(0).toInt(&ok2, 16);
66 quint32 end = (codeList.size() == 2) ? codeList.at(1).toInt(&ok2, 16) : start;
67 for (quint32 code = start; code<=end; ++code)
68 {
69 data.insert( code, catagory );
70 qDebug() << "[" << catagory << "] " << code;
71 }
72 }
73
74 out << catalog << data;
75}
QHash
ok
KGuiItem ok()
end
const KShortcut & end()
main
int main()
parseucd.cpp
Definition: parseucd.cpp:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Sonnet

Skip menu "Sonnet"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal