libzypp  17.31.31
metadatahelper.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
9 #ifndef ZYPP_CURL_PARSER_METADATAHELPER_H
10 #define ZYPP_CURL_PARSER_METADATAHELPER_H
11 
18 #include <zypp-core/Pathname.h>
19 #include <cstdio>
20 #include <vector>
21 
22 namespace zypp::media {
23 
24  enum class MetaDataType {
25  None = 0,
26  Zsync,
27  MetaLink
28  };
29 
30  constexpr auto minMetalinkProbeSize = 256; //< The nr of bytes we download to decide if we got a metadata file or not
31 
32  MetaDataType looks_like_meta_data( const std::vector<char> &data );
34  MetaDataType looks_like_meta_file( FILE *file );
35 }
36 
37 
38 #endif
MetaDataType looks_like_meta_file(const Pathname &file)
MetaDataType looks_like_meta_data(const std::vector< char > &data)
constexpr auto minMetalinkProbeSize