libzypp  10.5.0
MetaLinkParser.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_MEDIA_METALINKPARSER_H
00013 #define ZYPP_MEDIA_METALINKPARSER_H
00014 
00015 #include <string>
00016 
00017 #include "zypp/base/Exception.h"
00018 #include "zypp/base/NonCopyable.h"
00019 #include "zypp/base/InputStream.h"
00020 #include "zypp/media/MediaBlockList.h"
00021 #include "zypp/Url.h"
00022 
00023 namespace zypp {
00024   namespace media {
00025 
00026 struct ml_parsedata;
00027 
00028 class MetaLinkParser : private zypp::base::NonCopyable {
00029 public:
00030   MetaLinkParser();
00031   ~MetaLinkParser();
00032 
00037   void parse(const Pathname &filename);
00038 
00043   void parse(const InputStream &is);
00044 
00049   void parseBytes(const char* bytes, size_t len);
00054   void parseEnd();
00055 
00059   std::vector<Url> getUrls();
00063   MediaBlockList getBlockList();
00064 
00065 private:
00066   struct ml_parsedata *pd;
00067 };
00068 
00069   } // namespace media
00070 } // namespace zypp
00071 
00072 #endif // ZYPP_MEDIA_METALINKPARSER_H