• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • kasten
  • controllers
  • view
  • libbytearraychecksum
bytearraychecksumalgorithmfactory.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta Kasten module, made within the KDE community.
3 
4  Copyright 2009,2011 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) version 3, or any
10  later version accepted by the membership of KDE e.V. (or its
11  successor approved by the membership of KDE e.V.), which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 // QCA
24 // need to have this first, as QCA needs QT_NO_CAST_FROM_ASCII disabled when included
25 #include <config-qca2.h> //krazy:excludeall=includes
26 #ifdef HAVE_QCA2
27 // disable QT_NO_CAST_FROM_ASCII
28 #ifdef QT_NO_CAST_FROM_ASCII
29 #undef QT_NO_CAST_FROM_ASCII
30 #endif
31 #include <QtCrypto>
32 #endif
33 
34 
35 #include "bytearraychecksumalgorithmfactory.h"
36 
37 // lib
38 #include "algorithm/crc32bytearraychecksumalgorithm.h"
39 #include "algorithm/adler32bytearraychecksumalgorithm.h"
40 #include "algorithm/modsum8bytearraychecksumalgorithm.h"
41 #include "algorithm/modsum16bytearraychecksumalgorithm.h"
42 #include "algorithm/modsum32bytearraychecksumalgorithm.h"
43 #include "algorithm/modsum64bytearraychecksumalgorithm.h"
44 #ifdef HAVE_QCA2
45 #include "algorithm/qca2bytearraychecksumalgorithm.h"
46 #endif
47 // NEWCHECKSUM(start)
48 // Here add the name of your header file of your checksum algorithm,
49 // e.g.
50 // #include "algorithm/mybytearraychecksumalgorithm.h"
51 // NEWCHECKSUM(end)
52 // KDE
53 #include <KLocale>
54 
55 
56 #ifdef HAVE_QCA2
57 static inline void addQca2Algorithm( QList<AbstractByteArrayChecksumAlgorithm*>& algorithmList, const QString& name, const char* type )
58 {
59  if( QCA::isSupported(type) )
60  algorithmList << new Qca2ByteArrayChecksumAlgorithm( name, QString::fromLatin1(type) );
61 }
62 #endif
63 
64 QList<AbstractByteArrayChecksumAlgorithm*> ByteArrayChecksumAlgorithmFactory::createAlgorithms()
65 {
66  QList<AbstractByteArrayChecksumAlgorithm*> result;
67 
68  result
69  << new ModSum8ByteArrayChecksumAlgorithm()
70  << new ModSum16ByteArrayChecksumAlgorithm()
71  << new ModSum32ByteArrayChecksumAlgorithm()
72  << new ModSum64ByteArrayChecksumAlgorithm()
73  << new Adler32ByteArrayChecksumAlgorithm()
74  << new Crc32ByteArrayChecksumAlgorithm();
75 // NEWCHECKSUM(start)
76 // Here add the creation of an object of your checksum algorithm class and add it to the list,
77 // e.g.
78 // result
79 // << new MyByteArrayChecksumAlgorithm();
80 // NEWCHECKSUM(end)
81 
82 #ifdef HAVE_QCA2
83  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-0"), "sha0" );
84  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-1"), "sha1" );
85  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "MD2"), "md2" );
86  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "MD4"), "md4" );
87  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "MD5"), "md5" );
88  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "RIPEMD160"), "ripemd160" );
89  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-224"), "sha224" );
90  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-256"), "sha256" );
91  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-384"), "sha384" );
92  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "SHA-512"), "sha512" );
93  addQca2Algorithm( result, i18nc( "name of the hash algorithm", "Whirlpool"), "whirlpool" );
94 #endif
95 
96  return result;
97 }
qca2bytearraychecksumalgorithm.h
Adler32ByteArrayChecksumAlgorithm
Definition: adler32bytearraychecksumalgorithm.h:32
modsum64bytearraychecksumalgorithm.h
bytearraychecksumalgorithmfactory.h
Crc32ByteArrayChecksumAlgorithm
Definition: crc32bytearraychecksumalgorithm.h:32
ModSum64ByteArrayChecksumAlgorithm
Definition: modsum64bytearraychecksumalgorithm.h:32
ModSum8ByteArrayChecksumAlgorithm
Definition: modsum8bytearraychecksumalgorithm.h:32
ModSum32ByteArrayChecksumAlgorithm
Definition: modsum32bytearraychecksumalgorithm.h:32
modsum8bytearraychecksumalgorithm.h
ModSum16ByteArrayChecksumAlgorithm
Definition: modsum16bytearraychecksumalgorithm.h:32
Qca2ByteArrayChecksumAlgorithm
Definition: qca2bytearraychecksumalgorithm.h:32
modsum32bytearraychecksumalgorithm.h
modsum16bytearraychecksumalgorithm.h
adler32bytearraychecksumalgorithm.h
crc32bytearraychecksumalgorithm.h
ByteArrayChecksumAlgorithmFactory::createAlgorithms
static QList< AbstractByteArrayChecksumAlgorithm * > createAlgorithms()
Definition: bytearraychecksumalgorithmfactory.cpp:64
QList< AbstractByteArrayChecksumAlgorithm * >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

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

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



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