libzypp  17.25.3
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>
21 #include <zypp/Url.h>
22 
23 namespace zypp {
24  namespace media {
25 
26 struct ml_parsedata;
27 
29 public:
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();
64 
65 private:
66  struct ml_parsedata *pd;
67 };
68 
69  } // namespace media
70 } // namespace zypp
71 
72 #endif // ZYPP_MEDIA_METALINKPARSER_H
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
Exception.h
Url.h
MediaBlockList.h
zypp::media::MetaLinkParser::getUrls
std::vector< Url > getUrls()
return the download urls from the parsed metalink data
Definition: MetaLinkParser.cc:476
zypp::base::NonCopyable
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
zypp::media::MetaLinkParser::MetaLinkParser
MetaLinkParser()
Definition: MetaLinkParser.cc:420
zypp::InputStream
Helper to create and pass std::istream.
Definition: InputStream.h:57
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::media::MetaLinkParser::parse
void parse(const Pathname &filename)
parse a file consisting of metalink xml data
Definition: MetaLinkParser.cc:430
zypp::media::ml_parsedata
Definition: MetaLinkParser.cc:93
zypp::filesystem::Pathname
Pathname.
Definition: Pathname.h:45
zypp::media::MetaLinkParser::pd
struct ml_parsedata * pd
Definition: MetaLinkParser.h:66
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
InputStream.h
zypp::media::MetaLinkParser::~MetaLinkParser
~MetaLinkParser()
Definition: MetaLinkParser.cc:424
NonCopyable.h