libzypp: zypp/media/MetaLinkParser.h Source File

libzypp 17.25.10

MetaLinkParser.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_MEDIA_METALINKPARSER_H
13 #define ZYPP_MEDIA_METALINKPARSER_H
14
15 #include <string>
16
17 #include <zypp/base/Exception.h>
18 #include <zypp/base/NonCopyable.h>
19 #include <zypp/base/InputStream.h>
20 #include <zypp/media/MediaBlockList.h>
21 #include <zypp/Url.h>
22
23 namespace zypp {
24 namespace media {
25
26 struct ml_parsedata;
27
28 class MetaLinkParser : private zypp::base::NonCopyable {
29 public:
30 MetaLinkParser();
31 ~MetaLinkParser();
32
37 void parse(const Pathname &filename);
38
43 void parse(const InputStream &is);
44
49 void parseBytes(const char* bytes, size_t len);
54 void parseEnd();
55
59 std::vector<Url> getUrls();
63 MediaBlockList getBlockList();
64
65 private:
66 struct ml_parsedata *pd;
67 };
68
69 } // namespace media
70 } // namespace zypp
71
72 #endif // ZYPP_MEDIA_METALINKPARSER_H
Exception.h
InputStream.h
MediaBlockList.h
NonCopyable.h
Url.h
zypp::InputStream
Helper to create and pass std::istream.
Definition: InputStream.h:57
zypp::base::NonCopyable
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::media::MediaBlockList
Definition: MediaBlockList.h:35
zypp::media::MetaLinkParser
Definition: MetaLinkParser.h:28
zypp::media::MetaLinkParser::parseEnd
void parseEnd()
tells the parser that all chunks are now processed
Definition: MetaLinkParser.cc:466
zypp::media::MetaLinkParser::getBlockList
MediaBlockList getBlockList()
return the block list from the parsed metalink data
Definition: MetaLinkParser.cc:486
zypp::media::MetaLinkParser::getUrls
std::vector< Url > getUrls()
return the download urls from the parsed metalink data
Definition: MetaLinkParser.cc:476
zypp::media::MetaLinkParser::pd
struct ml_parsedata * pd
Definition: MetaLinkParser.h:66
zypp::media::MetaLinkParser::parse
void parse(const Pathname &filename)
parse a file consisting of metalink xml data
Definition: MetaLinkParser.cc:430
zypp::media::MetaLinkParser::parseBytes
void parseBytes(const char *bytes, size_t len)
parse a chunk of a file consisting of metalink xml data.
Definition: MetaLinkParser.cc:450
zypp::media::MetaLinkParser::~MetaLinkParser
~MetaLinkParser()
Definition: MetaLinkParser.cc:424
zypp::media::MetaLinkParser::MetaLinkParser
MetaLinkParser()
Definition: MetaLinkParser.cc:420
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::media::ml_parsedata
Definition: MetaLinkParser.cc:93