]>
git.saurik.com Git - apt.git/blob - apt-pkg/pkgsystem.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: pkgsystem.cc,v 1.3 2004/02/27 00:43:16 mdz Exp $
4 /* ######################################################################
6 System - Abstraction for running on different systems.
8 Basic general structure..
10 ##################################################################### */
12 // Include Files /*{{{*/
15 #include <apt-pkg/debsystem.h>
16 #include <apt-pkg/pkgsystem.h>
17 #include <apt-pkg/macros.h>
23 pkgSystem
*_system
= 0;
24 static pkgSystem
*SysList
[10];
25 pkgSystem
**pkgSystem::GlobalList
= SysList
;
26 unsigned long pkgSystem::GlobalListLen
= 0;
28 // System::pkgSystem - Constructor /*{{{*/
29 // ---------------------------------------------------------------------
30 /* Add it to the global list.. */
31 pkgSystem::pkgSystem(char const * const label
, pkgVersioningSystem
* const vs
) :
32 Label(label
), VS(vs
), d(NULL
)
34 assert(GlobalListLen
< sizeof(SysList
)/sizeof(*SysList
));
35 SysList
[GlobalListLen
] = this;
39 // System::GetSystem - Get the named system /*{{{*/
40 // ---------------------------------------------------------------------
42 APT_PURE pkgSystem
*pkgSystem::GetSystem(const char *Label
)
44 for (unsigned I
= 0; I
!= GlobalListLen
; I
++)
45 if (strcmp(SysList
[I
]->Label
,Label
) == 0)
50 bool pkgSystem::MultiArchSupported() const /*{{{*/
52 debSystem
const * const deb
= dynamic_cast<debSystem
const *>(this);
54 return deb
->SupportsMultiArch();
58 std::vector
<std::string
> pkgSystem::ArchitecturesSupported() const /*{{{*/
60 debSystem
const * const deb
= dynamic_cast<debSystem
const *>(this);
62 return deb
->SupportedArchitectures();
67 pkgSystem::~pkgSystem() {}