libzypp 17.31.23
metalinkparser.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_CURL_PARSER_METALINKPARSER_H_INCLUDED
13#define ZYPP_CURL_PARSER_METALINKPARSER_H_INCLUDED
14
15#include <string>
16
17#include <zypp-core/base/Exception.h>
18#include <zypp-core/base/NonCopyable.h>
19#include <zypp-core/base/InputStream>
20#include <zypp-curl/parser/MediaBlockList>
21#include <zypp-core/Url.h>
22#include <zypp-core/ByteArray.h>
23
24namespace zypp::media {
25
26struct ml_parsedata;
27
29 int priority = 0;
30 int maxConnections = -1; //< How many connections can be opened to that mirror, -1 means no limit was defined.
32};
33
35public:
38
43 void parse(const Pathname &filename);
44
49 void parse(const InputStream &is);
50
55 void parseBytes(const char* bytes, size_t len);
60 void parseEnd();
61
65 std::vector<Url> getUrls() const;
66
70 const std::vector<MetalinkMirror> &getMirrors() const;
71
76
77 const std::vector<UByteArray> &getZsyncBlockHashes() const;
78 const std::vector<UByteArray> &getSHA1BlockHashes() const;
79
80private:
82};
83
84UByteArray hexstr2bytes( std::string str );
85
86} // namespace zypp::media
87
88#endif // ZYPP_CURL_PARSER_METALINKPARSER_H_INCLUDED
Helper to create and pass std::istream.
Definition: inputstream.h:57
Url manipulation class.
Definition: Url.h:92
void parseEnd()
tells the parser that all chunks are now processed
struct ml_parsedata * pd
void parse(const Pathname &filename)
parse a file consisting of metalink xml data
MediaBlockList getBlockList() const
return the block list from the parsed metalink data
void parseBytes(const char *bytes, size_t len)
parse a chunk of a file consisting of metalink xml data.
const std::vector< UByteArray > & getSHA1BlockHashes() const
const std::vector< UByteArray > & getZsyncBlockHashes() const
const std::vector< MetalinkMirror > & getMirrors() const
return the mirrors from the parsed metalink data
std::vector< Url > getUrls() const
return the download urls from the parsed metalink data
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
UByteArray hexstr2bytes(std::string str)