fileformat/TopLevelBlock.h
Go to the documentation of this file.
00001 /* Copyright 2009 Andreas Gölzer
00002 
00003  This file is part of readESM.
00004 
00005  readESM is free software: you can redistribute it and/or modify it under the
00006  terms of the GNU General Public License as published by the Free Software
00007  Foundation, either version 3 of the License, or (at your option) any later
00008  version.
00009 
00010  readESM is distributed in the hope that it will be useful, but WITHOUT ANY
00011  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00013 
00014  You should have received a copy of the GNU General Public License along with
00015  readESM.  If not, see <http://www.gnu.org/licenses/>. */
00016 
00017 #ifndef TOPLEVELBLOCK_H
00018 #define TOPLEVELBLOCK_H
00019 
00020 #include "Block.h"
00021 #include "Reporter/Reporter.h"
00022 class EncryptedCertificate;
00023 #include "DataTypes/RawData.h"
00024 
00025 #include <QtCore/QCoreApplication>
00026 #include <QtCore/QString>
00027 
00028 class TopLevelBlock : public Block {
00029         Q_DECLARE_TR_FUNCTIONS(TopLevelBlock)
00030 
00031 public:
00032         TopLevelBlock(const DataPointer& filewalker);
00033         virtual QString title() const;
00034         virtual void checkSignature(const EncryptedCertificate& cert);
00035         virtual QString signatureValidity() const;
00036         friend Reporter& operator<<(Reporter& o, const TopLevelBlock& b);
00037         
00038 protected:
00039         virtual RawData signedBytes() const = 0;
00040         virtual RawData signatureBytes() const;
00041         virtual void printOn(Reporter& o) const;
00042         bool validSignature;
00043         bool hasSignature;
00044 };
00045 
00046 #endif