File: metadatahelper.h

package info (click to toggle)
libzypp 17.36.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 26,380 kB
  • sloc: cpp: 132,576; xml: 2,587; sh: 486; makefile: 26; python: 23
file content (38 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*---------------------------------------------------------------------\
|                          ____ _   __ __ ___                          |
|                         |__  / \ / / . \ . \                         |
|                           / / \ V /|  _/  _/                         |
|                          / /__ | | | | | |                           |
|                         /_____||_| |_| |_|                           |
|                                                                      |
\---------------------------------------------------------------------*/
#ifndef ZYPP_CURL_PARSER_METADATAHELPER_H
#define ZYPP_CURL_PARSER_METADATAHELPER_H

/*!
 * \file contains helpers for detecting and handling download metadata...
 *       e.g. zsync or metalink
 */


#include <zypp-core/Pathname.h>
#include <cstdio>
#include <vector>

namespace zypp::media {

  enum class MetaDataType {
    None  = 0,
    Zsync,
    MetaLink
  };

  constexpr auto minMetalinkProbeSize = 256; //< The nr of bytes we download to decide if we got a metadata file or not

  MetaDataType looks_like_meta_data( const std::vector<char> &data );
  MetaDataType looks_like_meta_file( const zypp::Pathname &file );
  MetaDataType looks_like_meta_file( FILE *file );
}


#endif