libzypp  13.10.6
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
void parseBytes(const char *bytes, size_t len)
parse a chunk of a file consisting of metalink xml data.
Helper to create and pass std::istream.
Definition: InputStream.h:56
void parse(const Pathname &filename)
parse a file consisting of metalink xml data
void parseEnd()
tells the parser that all chunks are now processed
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
struct ml_parsedata * pd
MediaBlockList getBlockList()
return the block list from the parsed metalink data
std::vector< Url > getUrls()
return the download urls from the parsed metalink data