Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ULSelectionParser.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |
00003 |                      __   __    ____ _____ ____                      |
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
00005 |                       \ V / _` \___ \ | |   __) |                    |
00006 |                        | | (_| |___) || |  / __/                     |
00007 |                        |_|\__,_|____/ |_| |_____|                    |
00008 |                                                                      |
00009 |                               core system                            |
00010 |                                                        (C) SuSE GmbH |
00011 \----------------------------------------------------------------------/
00012 
00013   File:         ULSelectionParser.h
00014 
00015   Author:       Klaus Kaempf <kkaempf@suse.de>
00016   Maintainer:   Klaus Kaempf <kkaempf@suse.de>
00017 
00018   Purpose: Parse UnitedLinux compatible selection files
00019 
00020 /-*/
00021 #ifndef ULSelectionParser_h
00022 #define ULSelectionParser_h
00023 
00024 #include <string>
00025 #include <list>
00026 #include <utility>
00027 #include <fstream>
00028 
00029 #include <y2util/Pathname.h>
00030 #include <y2util/TaggedParser.h>
00031 #include <y2util/TaggedFile.h>
00032 
00033 #include <y2pm/PMError.h>
00034 #include <y2pm/MediaAccessPtr.h>
00035 #include <y2pm/PMSelectionPtr.h>
00036 #include <y2pm/PMULSelectionDataProviderPtr.h>
00037 #include <y2pm/InstSrcPtr.h>
00038 
00039 #include <y2pm/ULSelectionParserPtr.h>
00040 
00041 class ULSelectionParser : public CountedRep {
00042     private:
00043         // the source
00044         const InstSrcPtr _source;
00045 
00046         // tag ids for the TaggedParser
00047         enum Tags {
00048             SELECTION,  // name version release arch
00049             SUMMARY,    // short summary (label)
00050             CATEGORY,
00051             VISIBLE,
00052             ORDER,              // ordering data
00053             RECOMMENDS,
00054             SUGGESTS,
00055             REQUIRES,
00056             PROVIDES,
00057             CONFLICTS,
00058             OBSOLETES,
00059             SIZE,
00060             INSPACKS,
00061             DELPACKS,
00062             NUM_TAGS
00063         };
00064 
00065         // our parser
00066         TaggedParser _parser;
00067         // our set of tags, initialized in constructor
00068         TaggedFile::TagSet _tagset;
00069 
00070         // pass data from current tagset to data provider
00071         PMSelectionPtr toProvider (PMULSelectionDataProviderPtr dataprovider);
00072 
00073     public:
00074         ULSelectionParser (const InstSrcPtr source);
00075         ~ULSelectionParser();
00076 
00083         PMError fromPath (const Pathname& path, PMSelectionPtr& selection);
00084 
00089         PMError fromMediaDir (std::list<PMSelectionPtr>& selections,
00090                 MediaAccessPtr media_r, const Pathname& descr_dir_r );
00091 
00092 };
00093 
00094 #endif //ULSelectionParser_h

Generated on Fri Nov 9 14:30:32 2007 for yast2-packagemanager by doxygen 1.3.6