summaryrefslogtreecommitdiff
path: root/ftparchive/override.h
blob: ea3b5b9c6d124526eeafeea0590f2a40106ce155 (plain)
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
39
40
41
42
43
44
45
46
47
48
// -*- mode: cpp; mode: fold -*-
// Description								/*{{{*/
/* ######################################################################

   Override

   Store the override file.

   ##################################################################### */
									/*}}}*/
#ifndef OVERRIDE_H
#define OVERRIDE_H

#include <map>
#include <string>

using std::string;
using std::map;

class Override
{
   public:

   struct Item
   {
      string Priority;
      string OldMaint;
      string NewMaint;

      map<string,string> FieldOverride;
      string SwapMaint(std::string_view Orig,bool &Failed);
      ~Item() {};
   };

   map<string,Item,std::less<>> Mapping;

   inline Item *GetItem(std::string_view Package)
   {
      return GetItem(Package, "");
   }
   Item *GetItem(std::string_view Package, std::string_view Architecture);

   bool ReadOverride(string const &File,bool const &Source = false);
   bool ReadExtraOverride(string const &File,bool const &Source = false);
};

#endif