Cupt
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
binaryversion.hpp
Go to the documentation of this file.
00001 /**************************************************************************
00002 *   Copyright (C) 2010 by Eugene V. Lyubimkin                             *
00003 *                                                                         *
00004 *   This program is free software; you can redistribute it and/or modify  *
00005 *   it under the terms of the GNU General Public License                  *
00006 *   (version 3 or above) as published by the Free Software Foundation.    *
00007 *                                                                         *
00008 *   This program is distributed in the hope that it will be useful,       *
00009 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00010 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00011 *   GNU General Public License for more details.                          *
00012 *                                                                         *
00013 *   You should have received a copy of the GNU GPL                        *
00014 *   along with this program; if not, write to the                         *
00015 *   Free Software Foundation, Inc.,                                       *
00016 *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA               *
00017 **************************************************************************/
00018 #ifndef CUPT_CACHE_BINARYVERSION_SEEN
00019 #define CUPT_CACHE_BINARYVERSION_SEEN
00020 
00022 
00023 #include <cupt/hashsums.hpp>
00024 #include <cupt/cache/version.hpp>
00025 #include <cupt/cache/relation.hpp>
00026 
00027 namespace cupt {
00028 namespace cache {
00029 
00031 struct CUPT_API BinaryVersion: public Version
00032 {
00034     struct RelationTypes
00035     {
00037         enum Type { PreDepends, Depends, Recommends, Suggests, Enhances, Conflicts, Breaks, Replaces, Count };
00038         static const string strings[]; 
00039         static const char* rawStrings[]; 
00040     };
00041     string architecture; 
00042     uint32_t installedSize; 
00043     string sourcePackageName; 
00044     string sourceVersionString; 
00045     bool essential; 
00046     RelationLine relations[RelationTypes::Count]; 
00047     vector< string > provides; 
00048     string shortDescription; 
00049     string longDescription; 
00050     string tags; 
00051     FileRecord file; 
00052 
00053     bool isInstalled() const; 
00054     virtual bool areHashesEqual(const shared_ptr< const Version >& other) const;
00055 
00057     static shared_ptr< BinaryVersion > parseFromFile(const Version::InitializationParameters&);
00058 };
00059 
00060 } // namespace
00061 } // namespace
00062 
00063 #endif
00064 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator