X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6c139d6e362f04a1582e8a8f511f8aeab031fecf..3b5421b4c75f5c85b48cbb61bf22642ff52a6352:/apt-pkg/contrib/configuration.h diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 7476346ef..c98b0bb14 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: configuration.h,v 1.1 1998/07/07 04:17:10 jgg Exp $ +// $Id: configuration.h,v 1.5 1998/10/20 02:39:27 jgg Exp $ /* ###################################################################### Configuration Class @@ -21,11 +21,11 @@ ##################################################################### */ /*}}}*/ // Header section: pkglib -#ifndef PKGLIB_TAGFILE_H -#define PKGLIB_TAGFILE_H +#ifndef PKGLIB_CONFIGURATION_H +#define PKGLIB_CONFIGURATION_H #ifdef __GNUG__ -#pragma interface "pkglib/configuration.h" +#pragma interface "apt-pkg/configuration.h" #endif #include @@ -36,6 +36,7 @@ class Configuration { string Value; string Tag; + Item *Parent; Item *Child; Item *Next; Item() : Child(0), Next(0) {}; @@ -48,14 +49,23 @@ class Configuration public: string Find(const char *Name,const char *Default = 0); + string FindFile(const char *Name,const char *Default = 0); + string FindDir(const char *Name,const char *Default = 0); int FindI(const char *Name,int Default = 0); - + bool FindB(const char *Name,bool Default = false); + + inline void Set(string Name,string Value) {Set(Name.c_str(),Value);}; void Set(const char *Name,string Value); - void Set(const char *Name,int Value); - + void Set(const char *Name,int Value); + + inline bool Exists(string Name) {return Exists(Name.c_str());}; + bool Exists(const char *Name); + Configuration(); }; extern Configuration *_config; +bool ReadConfigFile(Configuration &Conf,string File); + #endif