~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to ftparchive/override.h

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- mode: cpp; mode: fold -*-
 
2
// Description                                                          /*{{{*/
 
3
// $Id: override.h,v 1.2 2001/02/20 07:03:18 jgg Exp $
 
4
/* ######################################################################
 
5
 
 
6
   Override
 
7
   
 
8
   Store the override file.
 
9
   
 
10
   ##################################################################### */
 
11
                                                                        /*}}}*/
 
12
#ifndef OVERRIDE_H
 
13
#define OVERRIDE_H
 
14
 
 
15
#ifdef __GNUG__
 
16
#pragma interface "override.h"
 
17
#endif
 
18
 
 
19
#include <map>
 
20
#include <string>
 
21
    
 
22
class Override
 
23
{
 
24
   public:
 
25
   
 
26
   struct Item
 
27
   {
 
28
      string Priority;
 
29
      string Section;
 
30
      string OldMaint;
 
31
      string NewMaint;
 
32
      
 
33
      string SwapMaint(string Orig,bool &Failed);
 
34
   };
 
35
   
 
36
   map<string,Item> Mapping;
 
37
   
 
38
   inline Item *GetItem(string Package) 
 
39
   {
 
40
      map<string,Item>::iterator I = Mapping.find(Package);
 
41
      if (I == Mapping.end())
 
42
         return 0;
 
43
      return &I->second;
 
44
   };
 
45
   
 
46
   bool ReadOverride(string File,bool Source = false);
 
47
};
 
48
    
 
49
#endif
 
50