APT_IGNORE_DEPRECATED_PUSH
pkgAcquire::Item::Item(pkgAcquire * const owner) :
FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
- QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner)
+ QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner), d(NULL)
{
Owner->Add(this);
Status = StatIdle;
pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/
pkgAcqMetaBase * const transactionManager, IndexTarget const &target) :
- pkgAcquire::Item(Owner), Target(target), TransactionManager(transactionManager)
+ pkgAcquire::Item(Owner), d(NULL), Target(target), TransactionManager(transactionManager)
{
if (TransactionManager != this)
TransactionManager->Add(this);
std::vector<IndexTarget> const &IndexTargets,
IndexTarget const &DataTarget,
indexRecords * const MetaIndexParser)
-: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget),
+: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget), d(NULL),
MetaIndexParser(MetaIndexParser), LastMetaIndexParser(NULL), IndexTargets(IndexTargets),
AuthPass(false), IMSHit(false)
{
std::vector<IndexTarget> const &IndexTargets,
indexRecords * const MetaIndexParser) :
pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser),
- ClearsignedTarget(ClearsignedTarget),
+ d(NULL), ClearsignedTarget(ClearsignedTarget),
DetachedDataTarget(DetachedDataTarget)
{
// index targets + (worst case:) Release/Release.gpg
IndexTarget const &DetachedSigTarget,
vector<IndexTarget> const &IndexTargets,
indexRecords * const MetaIndexParser) :
- pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser),
+ pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser), d(NULL),
DetachedSigTarget(DetachedSigTarget)
{
if(_config->FindB("Debug::Acquire::Transaction", false) == true)
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &Target,
pkgAcqMetaIndex * const MetaIndex) :
- pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex)
+ pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL), MetaIndex(MetaIndex)
{
DestFile = GetPartialFileNameFromURI(Target.URI);
pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &Target)
-: pkgAcqTransactionItem(Owner, TransactionManager, Target)
+: pkgAcqTransactionItem(Owner, TransactionManager, Target), d(NULL)
{
}
/*}}}*/
pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &Target)
- : pkgAcqBaseIndex(Owner, TransactionManager, Target)
+ : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL)
{
Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &Target,
vector<DiffInfo> const &diffs)
- : pkgAcqBaseIndex(Owner, TransactionManager, Target),
+ : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL),
available_patches(diffs)
{
DestFile = GetPartialFileNameFromURI(Target.URI);
IndexTarget const &Target,
DiffInfo const &patch,
std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
- : pkgAcqBaseIndex(Owner, TransactionManager, Target),
+ : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL),
patch(patch), allPatches(allPatches), State(StateFetchDiff)
{
Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &Target)
- : pkgAcqBaseIndex(Owner, TransactionManager, Target), Stage(STAGE_DOWNLOAD)
+ : pkgAcqBaseIndex(Owner, TransactionManager, Target), d(NULL), Stage(STAGE_DOWNLOAD)
{
// autoselect the compression method
AutoSelectCompression();
pkgAcqArchive::pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources,
pkgRecords * const Recs,pkgCache::VerIterator const &Version,
string &StoreFilename) :
- Item(Owner), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs),
+ Item(Owner), d(NULL), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs),
StoreFilename(StoreFilename), Vf(Version.FileList()),
Trusted(false)
{
unsigned long long const Size,string const &Dsc,string const &ShortDesc,
const string &DestDir, const string &DestFilename,
bool const IsIndexFile) :
- Item(Owner), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes)
+ Item(Owner), d(NULL), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes)
{
Retries = _config->FindI("Acquire::Retries",0);
virtual std::string GetFinalFilename() const;
private:
- void *d;
+ void * const d;
friend class pkgAcqMetaBase;
};
class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/
/** \brief baseclass for the indexes files to manage them all together */
{
- void *d;
+ void * const d;
protected:
IndexTarget const Target;
HashStringList GetExpectedHashesFor(std::string const &MetaKey) const;
class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/
/** \brief the manager of a transaction */
{
- void *d;
+ void * const d;
protected:
std::vector<pkgAcqTransactionItem*> Transaction;
*/
class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
{
- void *d;
+ void * const d;
protected:
IndexTarget const DetachedSigTarget;
*/
class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
{
- void *d;
+ void * const d;
pkgAcqMetaIndex * const MetaIndex;
/** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/
class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
{
- void *d;
+ void * const d;
IndexTarget const ClearsignedTarget;
IndexTarget const DetachedDataTarget;
/** \brief Common base class for all classes that deal with fetching indexes {{{*/
class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem
{
- void *d;
+ void * const d;
public:
/** \brief Get the full pathname of the final file for the current URI */
*/
class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
protected:
/** \brief If \b true, debugging information will be written to std::clog. */
*/
class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
protected:
*/
class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
private:
*/
class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex
{
- void *d;
+ void * const d;
protected:
*/
class pkgAcqArchive : public pkgAcquire::Item
{
- void *d;
+ void * const d;
bool LocalSource;
HashStringList ExpectedHashes;
*/
class pkgAcqChangelog : public pkgAcquire::Item
{
- void *d;
+ void * const d;
std::string TemporaryDirectory;
std::string const SrcName;
std::string const SrcVersion;
*/
class pkgAcqFile : public pkgAcquire::Item
{
- void *d;
+ void * const d;
/** \brief How many times to retry the download, set from
* Acquire::Retries.
// ---------------------------------------------------------------------
/* */
pkgAcqMethod::FetchResult::FetchResult() : LastModified(0),
- IMSHit(false), Size(0), ResumePoint(0)
+ IMSHit(false), Size(0), ResumePoint(0), d(NULL)
{
}
/*}}}*/
/*}}}*/
pkgAcqMethod::~pkgAcqMethod() {}
-pkgAcqMethod::FetchItem::FetchItem() {}
+pkgAcqMethod::FetchItem::FetchItem() : d(NULL) {}
pkgAcqMethod::FetchItem::~FetchItem() {}
pkgAcqMethod::FetchResult::~FetchResult() {}
FetchItem();
virtual ~FetchItem();
private:
- void *d;
+ void * const d;
};
struct FetchResult
FetchResult();
virtual ~FetchResult();
private:
- void *d;
+ void * const d;
};
// State
// ---------------------------------------------------------------------
/* */
pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf,
- pkgAcquireStatus *log) : Log(log)
+ pkgAcquireStatus *log) : d(NULL), Log(log)
{
OwnerQ = Q;
Config = Cnf;
// Worker::Worker - Constructor for method config startup /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcquire::Worker::Worker(MethodConfig *Cnf)
+pkgAcquire::Worker::Worker(MethodConfig *Cnf) : d(NULL), OwnerQ(NULL), Config(Cnf),
+ Access(Cnf->Access), CurrentItem(NULL),
+ CurrentSize(0), TotalSize(0)
{
- OwnerQ = 0;
- Config = Cnf;
- Access = Cnf->Access;
- CurrentItem = 0;
- TotalSize = 0;
- CurrentSize = 0;
-
Construct();
}
/*}}}*/
class pkgAcquire::Worker : public WeakPointable
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
friend class pkgAcquire;
// Acquire::pkgAcquire - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* We grab some runtime state from the configuration space */
-pkgAcquire::pkgAcquire() : LockFD(-1), Queues(0), Workers(0), Configs(0), Log(NULL), ToFetch(0),
+pkgAcquire::pkgAcquire() : LockFD(-1), d(NULL), Queues(0), Workers(0), Configs(0), Log(NULL), ToFetch(0),
Debug(_config->FindB("Debug::pkgAcquire",false)),
Running(false)
{
Initialize();
}
-pkgAcquire::pkgAcquire(pkgAcquireStatus *Progress) : LockFD(-1), Queues(0), Workers(0),
+pkgAcquire::pkgAcquire(pkgAcquireStatus *Progress) : LockFD(-1), d(NULL), Queues(0), Workers(0),
Configs(0), Log(NULL), ToFetch(0),
Debug(_config->FindB("Debug::pkgAcquire",false)),
Running(false)
/** \brief FD of the Lock file we acquire in Setup (if any) */
int LockFD;
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
public:
friend class pkgAcquire::Worker;
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
/** \brief The next queue in the pkgAcquire object's list of queues. */
Queue *Next;
class pkgAcquire::UriIterator
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
/** The next queue to iterate over. */
pkgAcquire::Queue *CurQ;
struct pkgAcquire::MethodConfig
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
/** \brief The next link on the acquire method list.
*
class pkgAcquireStatus
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
/* The legacy translations here of input Pkg iterators is obsolete,
this is not necessary since the pkgCaches are fully shared now. */
pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache),
- iPolicy(Cache),
+ d(NULL), iPolicy(Cache),
Sim(&Cache->GetCache(),&iPolicy),
group(Sim)
{
class pkgSimulate : public pkgPackageManager /*{{{*/
{
- void *d;
+ void * const d;
protected:
class Policy : public pkgDepCache::Policy
{
private:
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
pkgDepCache &Cache;
typedef pkgCache::PkgIterator PkgIterator;
class pkgCacheFile
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
/*}}}*/
CacheSetHelper::CacheSetHelper(bool const ShowError, GlobalError::MsgType ErrorType) :
- ShowError(ShowError), ErrorType(ErrorType) {}
+ ShowError(ShowError), ErrorType(ErrorType), d(NULL) {}
CacheSetHelper::~CacheSetHelper() {}
-PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {}
-PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {}
+PackageContainerInterface::PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN), d(NULL) {}
+PackageContainerInterface::PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by), d(NULL) {}
+PackageContainerInterface& PackageContainerInterface::operator=(PackageContainerInterface const &other) {
+ if (this != &other)
+ this->ConstructedBy = other.ConstructedBy;
+ return *this;
+}
PackageContainerInterface::~PackageContainerInterface() {}
-PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
+PackageUniverse::PackageUniverse(pkgCache * const Owner) : _cont(Owner), d(NULL) { }
PackageUniverse::~PackageUniverse() {}
-VersionContainerInterface::VersionContainerInterface() {}
+VersionContainerInterface::VersionContainerInterface() : d(NULL) {}
+VersionContainerInterface& VersionContainerInterface::operator=(VersionContainerInterface const &) {
+ return *this;
+}
+
VersionContainerInterface::~VersionContainerInterface() {}
}
bool PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
bool PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
private:
- void *d;
+ void * const d;
}; /*}}}*/
class PackageContainerInterface { /*{{{*/
CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
PackageContainerInterface();
explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by);
+ PackageContainerInterface& operator=(PackageContainerInterface const &other);
virtual ~PackageContainerInterface();
APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
private:
CacheSetHelper::PkgSelector ConstructedBy;
- void *d;
+ void * const d;
};
/*}}}*/
template<class Container> class PackageContainer : public PackageContainerInterface {/*{{{*/
private methods. */
class APT_HIDDEN PackageUniverse : public PackageContainerInterface {
pkgCache * const _cont;
- void *d;
+ void * const d;
public:
typedef pkgCache::PkgIterator iterator;
typedef pkgCache::PkgIterator const_iterator;
APT_IGNORE_DEPRECATED_POP
VersionContainerInterface();
+ VersionContainerInterface& operator=(VersionContainerInterface const &other);
virtual ~VersionContainerInterface();
private:
- void *d;
+ void * const d;
protected: /*{{{*/
}
/*}}}*/
pkgUdevCdromDevices::pkgUdevCdromDevices() /*{{{*/
-: libudev_handle(NULL), udev_new(NULL), udev_enumerate_add_match_property(NULL),
+: d(NULL), libudev_handle(NULL), udev_new(NULL), udev_enumerate_add_match_property(NULL),
udev_enumerate_scan_devices(NULL), udev_enumerate_get_list_entry(NULL),
udev_device_new_from_syspath(NULL), udev_enumerate_get_udev(NULL),
udev_list_entry_get_name(NULL), udev_device_get_devnode(NULL),
}
/*}}}*/
-pkgCdromStatus::pkgCdromStatus() : totalSteps(0) {}
+pkgCdromStatus::pkgCdromStatus() : d(NULL), totalSteps(0) {}
pkgCdromStatus::~pkgCdromStatus() {}
-pkgCdrom::pkgCdrom() {}
+pkgCdrom::pkgCdrom() : d(NULL) {}
pkgCdrom::~pkgCdrom() {}
class pkgCdromStatus /*{{{*/
{
- void *d;
+ void * const d;
protected:
int totalSteps;
virtual ~pkgCdrom();
private:
- void *d;
+ void * const d;
APT_HIDDEN bool MountAndIdentCDROM(Configuration &Database, std::string &CDROM,
std::string &ident, pkgCdromStatus * const log, bool const interactive);
/*}}}*/
class pkgUdevCdromDevices /*{{{*/
{
- void *d;
+ void * const d;
protected:
// libudev dlopen structure
void *libudev_handle;
}
/*}}}*/
-pkgArchiveCleaner::pkgArchiveCleaner() {}
+pkgArchiveCleaner::pkgArchiveCleaner() : d(NULL) {}
APT_CONST pkgArchiveCleaner::~pkgArchiveCleaner() {}
class pkgArchiveCleaner
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
~FileFdPrivate() { CloseDown(""); }
};
/*}}}*/
+// FileFd Constructors /*{{{*/
+FileFd::FileFd(std::string FileName,unsigned int const Mode,unsigned long AccessMode) : iFd(-1), Flags(0), d(NULL)
+{
+ Open(FileName,Mode, None, AccessMode);
+}
+FileFd::FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long AccessMode) : iFd(-1), Flags(0), d(NULL)
+{
+ Open(FileName,Mode, Compress, AccessMode);
+}
+FileFd::FileFd() : iFd(-1), Flags(AutoClose), d(NULL) {}
+FileFd::FileFd(int const Fd, unsigned int const Mode, CompressMode Compress) : iFd(-1), Flags(0), d(NULL)
+{
+ OpenDescriptor(Fd, Mode, Compress);
+}
+FileFd::FileFd(int const Fd, bool const AutoClose) : iFd(-1), Flags(0), d(NULL)
+{
+ OpenDescriptor(Fd, ReadWrite, None, AutoClose);
+}
+ /*}}}*/
// FileFd::Open - Open a file /*{{{*/
// ---------------------------------------------------------------------
/* The most commonly used open mode combinations are given with Mode */
inline bool Eof() {return (Flags & HitEof) == HitEof;};
inline bool IsCompressed() {return (Flags & Compressed) == Compressed;};
inline std::string &Name() {return FileName;};
-
- FileFd(std::string FileName,unsigned int const Mode,unsigned long AccessMode = 0666) : iFd(-1), Flags(0), d(NULL)
- {
- Open(FileName,Mode, None, AccessMode);
- };
- FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long AccessMode = 0666) : iFd(-1), Flags(0), d(NULL)
- {
- Open(FileName,Mode, Compress, AccessMode);
- };
- FileFd() : iFd(-1), Flags(AutoClose), d(NULL) {};
- FileFd(int const Fd, unsigned int const Mode = ReadWrite, CompressMode Compress = None) : iFd(-1), Flags(0), d(NULL)
- {
- OpenDescriptor(Fd, Mode, Compress);
- };
- FileFd(int const Fd, bool const AutoClose) : iFd(-1), Flags(0), d(NULL)
- {
- OpenDescriptor(Fd, ReadWrite, None, AutoClose);
- };
+
+ FileFd(std::string FileName,unsigned int const Mode,unsigned long AccessMode = 0666);
+ FileFd(std::string FileName,unsigned int const Mode, CompressMode Compress, unsigned long AccessMode = 0666);
+ FileFd();
+ FileFd(int const Fd, unsigned int const Mode = ReadWrite, CompressMode Compress = None);
+ FileFd(int const Fd, bool const AutoClose);
virtual ~FileFd();
private:
- FileFdPrivate* d;
+ FileFdPrivate * d;
+ APT_HIDDEN FileFd & operator=(const FileFd &);
APT_HIDDEN bool OpenInternDescriptor(unsigned int const Mode, APT::Configuration::Compressor const &compressor);
// private helpers to set Fail flag and call _error->Error
unsigned int CalcHashes;
explicit PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {}
+ explicit PrivateHashes(HashStringList const &Hashes) : FileSize(0) {
+ unsigned int calcHashes = Hashes.usable() ? 0 : ~0;
+ if (Hashes.find("MD5Sum") != NULL)
+ calcHashes |= Hashes::MD5SUM;
+ if (Hashes.find("SHA1") != NULL)
+ calcHashes |= Hashes::SHA1SUM;
+ if (Hashes.find("SHA256") != NULL)
+ calcHashes |= Hashes::SHA256SUM;
+ if (Hashes.find("SHA512") != NULL)
+ calcHashes |= Hashes::SHA512SUM;
+ CalcHashes = calcHashes;
+ }
};
/*}}}*/
// Hashes::Add* - Add the contents of data or FD /*{{{*/
return hashes;
}
APT_IGNORE_DEPRECATED_PUSH
-Hashes::Hashes() { d = new PrivateHashes(~0); }
-Hashes::Hashes(unsigned int const Hashes) { d = new PrivateHashes(Hashes); }
-Hashes::Hashes(HashStringList const &Hashes) {
- unsigned int calcHashes = Hashes.usable() ? 0 : ~0;
- if (Hashes.find("MD5Sum") != NULL)
- calcHashes |= MD5SUM;
- if (Hashes.find("SHA1") != NULL)
- calcHashes |= SHA1SUM;
- if (Hashes.find("SHA256") != NULL)
- calcHashes |= SHA256SUM;
- if (Hashes.find("SHA512") != NULL)
- calcHashes |= SHA512SUM;
- d = new PrivateHashes(calcHashes);
-}
+Hashes::Hashes() : d(new PrivateHashes(~0)) { }
+Hashes::Hashes(unsigned int const Hashes) : d(new PrivateHashes(Hashes)) {}
+Hashes::Hashes(HashStringList const &Hashes) : d(new PrivateHashes(Hashes)) {}
Hashes::~Hashes() { delete d; }
APT_IGNORE_DEPRECATED_POP
class PrivateHashes;
class Hashes
{
- PrivateHashes *d;
+ PrivateHashes * const d;
public:
/* those will disappear in the future as it is hard to add new ones this way.
// ---------------------------------------------------------------------
/* */
debSourcesIndex::debSourcesIndex(IndexTarget const &Target,bool const Trusted) :
- pkgIndexTargetFile(Target, Trusted)
+ pkgIndexTargetFile(Target, Trusted), d(NULL)
{
}
/*}}}*/
// ---------------------------------------------------------------------
/* */
debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted) :
- pkgIndexTargetFile(Target, Trusted)
+ pkgIndexTargetFile(Target, Trusted), d(NULL)
{
}
/*}}}*/
// TranslationsIndex::debTranslationsIndex - Contructor /*{{{*/
debTranslationsIndex::debTranslationsIndex(IndexTarget const &Target) :
- pkgIndexTargetFile(Target, true)
+ pkgIndexTargetFile(Target, true), d(NULL)
{}
/*}}}*/
bool debTranslationsIndex::HasPackages() const /*{{{*/
// StatusIndex::debStatusIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), File(File)
+debStatusIndex::debStatusIndex(string File) : pkgIndexFile(true), d(NULL), File(File)
{
}
/*}}}*/
// debDebPkgFile - Single .deb file /*{{{*/
debDebPkgFileIndex::debDebPkgFileIndex(std::string DebFile)
- : pkgIndexFile(true), DebFile(DebFile)
+ : pkgIndexFile(true), d(NULL), DebFile(DebFile)
{
DebFileFullPath = flAbsPath(DebFile);
}
// debDscFileIndex stuff
debDscFileIndex::debDscFileIndex(std::string &DscFile)
- : pkgIndexFile(true), DscFile(DscFile)
+ : pkgIndexFile(true), d(NULL), DscFile(DscFile)
{
}
class APT_HIDDEN debStatusIndex : public pkgIndexFile
{
- void *d;
+ void * const d;
protected:
std::string File;
class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile
{
- void *d;
+ void * const d;
public:
virtual const Type *GetType() const APT_CONST;
class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile
{
- void *d;
+ void * const d;
public:
virtual const Type *GetType() const APT_CONST;
class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile
{
- void *d;
+ void * const d;
public:
virtual const Type *GetType() const APT_CONST;
class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile
{
private:
- void *d;
+ void * const d;
std::string DebFile;
std::string DebFileFullPath;
class APT_HIDDEN debDscFileIndex : public pkgIndexFile
{
private:
- void *d;
+ void * const d;
std::string DscFile;
public:
virtual const Type *GetType() const APT_CONST;
/* Provide an architecture and only this one and "all" will be accepted
in Step(), if no Architecture is given we will accept every arch
we would accept in general with checkArchitecture() */
-debListParser::debListParser(FileFd *File, string const &Arch) : Tags(File),
+debListParser::debListParser(FileFd *File, string const &Arch) : d(NULL), Tags(File),
Arch(Arch) {
if (Arch == "native")
this->Arch = _config->Find("APT::Architecture");
private:
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
pkgTagFile Tags;
}
debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist) :
- metaIndex(URI, Dist, "deb"), Trusted(CHECK_TRUST)
+ metaIndex(URI, Dist, "deb"), d(NULL), Trusted(CHECK_TRUST)
{}
debReleaseIndex::debReleaseIndex(string const &URI, string const &Dist, bool const Trusted) :
- metaIndex(URI, Dist, "deb") {
+ metaIndex(URI, Dist, "deb"), d(NULL) {
SetTrusted(Trusted);
}
};
debDebFileMetaIndex::debDebFileMetaIndex(std::string const &DebFile)
- : metaIndex(DebFile, "local-uri", "deb-dist"), DebFile(DebFile)
+ : metaIndex(DebFile, "local-uri", "deb-dist"), d(NULL), DebFile(DebFile)
{
DebIndex = new debDebPkgFileIndex(DebFile);
Indexes = new vector<pkgIndexFile *>();
private:
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
class APT_HIDDEN debDebFileMetaIndex : public metaIndex
{
private:
- void *d;
+ void * const d;
std::string DebFile;
debDebPkgFileIndex *DebIndex;
public:
// RecordParser::debRecordParser - Constructor /*{{{*/
debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
- debRecordParserBase(), File(FileName, FileFd::ReadOnly, FileFd::Extension),
+ debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension),
Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200)
{
}
/*}}}*/
debRecordParser::~debRecordParser() {}
-debRecordParserBase::debRecordParserBase() : Parser() {}
+debRecordParserBase::debRecordParserBase() : Parser(), d(NULL) {}
// RecordParserBase::FileName - Return the archive filename on the site /*{{{*/
string debRecordParserBase::FileName()
{
bool debDebFileRecordParser::Jump(pkgCache::DescFileIterator const &) { return LoadContent(); }
std::string debDebFileRecordParser::FileName() { return debFileName; }
-debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), debFileName(FileName) {}
+debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), d(NULL), debFileName(FileName) {}
debDebFileRecordParser::~debDebFileRecordParser() {}
class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser
{
- void *d;
+ void * const d;
protected:
pkgTagSection Section;
class APT_HIDDEN debRecordParser : public debRecordParserBase
{
- void *d;
+ void * const d;
protected:
FileFd File;
pkgTagFile Tags;
// custom record parser that reads deb files directly
class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase
{
- void *d;
+ void * const d;
std::string debFileName;
std::string controlContent;
using std::string;
debSrcRecordParser::debSrcRecordParser(std::string const &File,pkgIndexFile const *Index)
- : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400),
+ : Parser(Index), d(NULL), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400),
iOffset(0), Buffer(NULL) {}
// SrcRecordParser::Binaries - Return the binaries field /*{{{*/
class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
FileFd Fd;
// System::debSystem - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-debSystem::debSystem()
+debSystem::debSystem() : pkgSystem("Debian dpkg interface", &debVS), d(new debSystemPrivate())
{
- d = new debSystemPrivate();
- Label = "Debian dpkg interface";
- VS = &debVS;
}
/*}}}*/
// System::~debSystem - Destructor /*{{{*/
class debSystem : public pkgSystem
{
// private d-pointer
- debSystemPrivate *d;
+ debSystemPrivate * const d;
APT_HIDDEN bool CheckUpdates();
public:
// DPkgPM::pkgDPkgPM - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache)
- : pkgPackageManager(Cache), pkgFailures(0), PackagesDone(0), PackagesTotal(0)
+pkgDPkgPM::pkgDPkgPM(pkgDepCache *Cache)
+ : pkgPackageManager(Cache),d(new pkgDPkgPMPrivate()), pkgFailures(0), PackagesDone(0), PackagesTotal(0)
{
- d = new pkgDPkgPMPrivate();
}
/*}}}*/
// DPkgPM::pkgDPkgPM - Destructor /*{{{*/
class pkgDPkgPM : public pkgPackageManager
{
private:
- pkgDPkgPMPrivate *d;
+ pkgDPkgPMPrivate * const d;
/** \brief record the disappear action and handle accordingly
}
/*}}}*/
pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) : /*{{{*/
- cache(cache), released(false)
+ d(NULL), cache(cache), released(false)
{
++cache.group_level;
}
pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) :
group_level(0), Cache(pCache), PkgState(0), DepState(0),
iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0),
- iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0)
+ iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0), d(NULL)
{
DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false);
DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false);
*/
class ActionGroup
{
- void *d;
+ void * const d;
pkgDepCache &cache;
bool released;
bool const rPurge, unsigned long const Depth, bool const FromUser);
private:
- void *d;
+ void * const d;
APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
unsigned long const Depth, bool const FromUser);
// edspIndex::edspIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-edspIndex::edspIndex(std::string File) : debStatusIndex(File)
+edspIndex::edspIndex(std::string File) : debStatusIndex(File), d(NULL)
{
}
/*}}}*/
class APT_HIDDEN edspIndex : public debStatusIndex
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
public:
/*}}}*/
// ListParser::edspListParser - Constructor /*{{{*/
-edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch)
+edspListParser::edspListParser(FileFd *File, std::string const &Arch) : debListParser(File, Arch), d(NULL)
{}
/*}}}*/
// ListParser::NewVersion - Fill in the version structure /*{{{*/
class APT_HIDDEN edspListParser : public debListParser
{
- void *d;
+ void * const d;
public:
virtual bool NewVersion(pkgCache::VerIterator &Ver);
virtual std::string Description();
#include <apti18n.h>
/*}}}*/
-// System::debSystem - Constructor /*{{{*/
-edspSystem::edspSystem()
+// System::edspSystem - Constructor /*{{{*/
+edspSystem::edspSystem() : pkgSystem("Debian APT solver interface", &debVS), d(NULL), StatusFile(NULL)
{
- StatusFile = 0;
-
- Label = "Debian APT solver interface";
- VS = &debVS;
}
/*}}}*/
// System::~debSystem - Destructor /*{{{*/
class APT_HIDDEN edspSystem : public pkgSystem
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
edspIndex *StatusFile;
}
/*}}}*/
-IndexCopy::IndexCopy() {}
+IndexCopy::IndexCopy() : d(NULL) {}
APT_CONST IndexCopy::~IndexCopy() {}
-PackageCopy::PackageCopy() : IndexCopy() {}
+PackageCopy::PackageCopy() : IndexCopy(), d(NULL) {}
APT_CONST PackageCopy::~PackageCopy() {}
-SourceCopy::SourceCopy() : IndexCopy() {}
+SourceCopy::SourceCopy() : IndexCopy(), d(NULL) {}
APT_CONST SourceCopy::~SourceCopy() {}
-TranslationsCopy::TranslationsCopy() {}
+TranslationsCopy::TranslationsCopy() : d(NULL) {}
APT_CONST TranslationsCopy::~TranslationsCopy() {}
-SigVerify::SigVerify() {}
+SigVerify::SigVerify() : d(NULL) {}
APT_CONST SigVerify::~SigVerify() {}
class IndexCopy /*{{{*/
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
protected:
/*}}}*/
class PackageCopy : public IndexCopy /*{{{*/
{
- void *d;
+ void * const d;
protected:
virtual bool GetFile(std::string &Filename,unsigned long long &Size);
/*}}}*/
class SourceCopy : public IndexCopy /*{{{*/
{
- void *d;
+ void * const d;
protected:
virtual bool GetFile(std::string &Filename,unsigned long long &Size);
/*}}}*/
class TranslationsCopy /*{{{*/
{
- void *d;
+ void * const d;
protected:
pkgTagSection *Section;
class SigVerify /*{{{*/
{
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records);
APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName,
}
/*}}}*/
pkgIndexFile::pkgIndexFile(bool Trusted) : /*{{{*/
- Trusted(Trusted)
+ d(NULL), Trusted(Trusted)
{
}
/*}}}*/
/*}}}*/
pkgIndexTargetFile::pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted) :/*{{{*/
- pkgIndexFile(Trusted), Target(Target)
+ pkgIndexFile(Trusted), d(NULL), Target(Target)
{
}
/*}}}*/
class pkgIndexFile
{
- void *d;
+ void * const d;
protected:
bool Trusted;
class pkgIndexTargetFile : public pkgIndexFile
{
- void *d;
+ void * const d;
protected:
IndexTarget const Target;
private:
enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
// dpointer (for later)
- void * d;
+ void * const d;
protected:
std::string Dist;
}
PackageManagerProgressFd::PackageManagerProgressFd(int progress_fd)
- : StepsDone(0), StepsTotal(1)
+ : d(NULL), StepsDone(0), StepsTotal(1)
{
OutStatusFd = progress_fd;
}
PackageManagerProgressDeb822Fd::PackageManagerProgressDeb822Fd(int progress_fd)
- : StepsDone(0), StepsTotal(1)
+ : d(NULL), StepsDone(0), StepsTotal(1)
{
OutStatusFd = progress_fd;
}
PackageManagerFancy::PackageManagerFancy()
- : child_pty(-1)
+ : d(NULL), child_pty(-1)
{
// setup terminal size
old_SIGWINCH = signal(SIGWINCH, PackageManagerFancy::staticSIGWINCH);
return true;
}
-PackageManagerText::PackageManagerText() : PackageManager() {}
+PackageManagerText::PackageManagerText() : PackageManager(), d(NULL) {}
PackageManagerText::~PackageManagerText() {}
{
private:
/** \brief dpointer placeholder */
- void *d;
+ void * const d;
protected:
std::string progress_str;
class PackageManagerProgressFd : public PackageManager
{
- void *d;
+ void * const d;
protected:
int OutStatusFd;
int StepsDone;
class PackageManagerProgressDeb822Fd : public PackageManager
{
- void *d;
+ void * const d;
protected:
int OutStatusFd;
int StepsDone;
class PackageManagerFancy : public PackageManager
{
- void *d;
+ void * const d;
private:
APT_HIDDEN static void staticSIGWINCH(int);
static std::vector<PackageManagerFancy*> instances;
class PackageManagerText : public PackageManager
{
- void *d;
+ void * const d;
public:
virtual bool StatusChanged(std::string PackageName,
unsigned int StepsDone,
metaIndex::metaIndex(std::string const &URI, std::string const &Dist,
char const * const Type)
-: Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
+: d(NULL), Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
{
/* nothing */
}
class metaIndex
{
- void *d;
+ void * const d;
protected:
std::vector <pkgIndexFile *> *Indexes;
const char *Type;
// OrderList::pkgOrderList - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache),
+pkgOrderList::pkgOrderList(pkgDepCache *pCache) : d(NULL), Cache(*pCache),
Primary(NULL), Secondary(NULL),
RevDepends(NULL), Remove(NULL),
AfterEnd(NULL), FileList(NULL),
class pkgDepCache;
class pkgOrderList : protected pkgCache::Namespace
{
- void *d;
+ void * const d;
protected:
pkgDepCache &Cache;
// ---------------------------------------------------------------------
/* */
pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache),
- List(NULL), Res(Incomplete)
+ List(NULL), Res(Incomplete), d(NULL)
{
FileNames = new string[Cache.Head().PackageCount];
Debug = _config->FindB("Debug::pkgPackageManager",false);
virtual ~pkgPackageManager();
private:
- void *d;
+ void * const d;
enum APT_HIDDEN SmartAction { UNPACK_IMMEDIATE, UNPACK, CONFIGURE };
APT_HIDDEN bool NonLoopingSmart(SmartAction const action, pkgCache::PkgIterator &Pkg,
pkgCache::PkgIterator DepPkg, int const Depth, bool const PkgLoop,
// ---------------------------------------------------------------------
/* */
APT_IGNORE_DEPRECATED_PUSH
-pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map)
+pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), d(NULL)
{
// call getArchitectures() with cached=false to ensure that the
// architectures cache is re-evaulated. this is needed in cases
virtual ~pkgCache();
private:
- void *d;
+ void * const d;
bool MultiArchEnabled;
APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name);
};
/* We set the dirty flag and make sure that is written to the disk */
pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
Map(*pMap), Cache(pMap,false), Progress(Prog),
- CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0)
+ CurrentRlsFile(NULL), CurrentFile(NULL), FoundFileDeps(0), d(NULL)
{
if (_error->PendingError() == true)
return;
}
/*}}}*/
-pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {}
+pkgCacheGenerator::ListParser::ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false), d(NULL) {}
pkgCacheGenerator::ListParser::~ListParser() {}
virtual ~pkgCacheGenerator();
private:
- void *d;
+ void * const d;
APT_HIDDEN bool MergeListGroup(ListParser &List, std::string const &GrpName);
APT_HIDDEN bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg);
APT_HIDDEN bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg,
// Flag file dependencies
bool FoundFileDeps;
- void *d;
+ void * const d;
protected:
}
/*}}}*/
-pkgRecords::Parser::Parser() {}
+pkgRecords::Parser::Parser() : d(NULL) {}
pkgRecords::Parser::~Parser() {}
private:
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
pkgCache &Cache;
std::vector<Parser *>Files;
virtual ~Parser();
private:
- void *d;
+ void * const d;
APT_HIDDEN std::string GetHashFromHashes(char const * const type) const
{
HashStringList const hashes = Hashes();
// System::pkgSystem - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Add it to the global list.. */
-pkgSystem::pkgSystem() : Label(NULL), VS(NULL)
+pkgSystem::pkgSystem(char const * const label, pkgVersioningSystem * const vs) :
+ Label(label), VS(vs), d(NULL)
{
assert(GlobalListLen < sizeof(SysList)/sizeof(*SysList));
SysList[GlobalListLen] = this;
static unsigned long GlobalListLen;
static pkgSystem *GetSystem(const char *Label);
- const char *Label;
- pkgVersioningSystem *VS;
+ const char * const Label;
+ pkgVersioningSystem * const VS;
/* Prevent other programs from touching shared data not covered by
other locks (cache or state locks) */
virtual signed Score(Configuration const &/*Cnf*/) {
return 0;
};
-
- pkgSystem();
+
+ pkgSystem(char const * const Label, pkgVersioningSystem * const VS);
virtual ~pkgSystem();
private:
- void *d;
+ void * const d;
};
// The environment we are operating in.
// ---------------------------------------------------------------------
/* Set the defaults for operation. The default mode with no loaded policy
file matches the V0 policy engine. */
-pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
+pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner), d(NULL)
{
if (Owner == 0)
return;
explicit pkgPolicy(pkgCache *Owner);
virtual ~pkgPolicy();
private:
- pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg);
- void *d;
+ APT_HIDDEN pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg);
+ void * const d;
};
bool ReadPinFile(pkgPolicy &Plcy, std::string File = "");
// SourceList::pkgSourceList - Constructors /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgSourceList::pkgSourceList()
+pkgSourceList::pkgSourceList() : d(NULL)
{
}
-pkgSourceList::pkgSourceList(string File)
+pkgSourceList::pkgSourceList(string File) : d(NULL)
{
Read(File);
}
class pkgSourceList
{
- void *d;
+ void * const d;
public:
// List of supported source list types
/*}}}*/
-pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : iIndex(Index) {}
+pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : d(NULL), iIndex(Index) {}
pkgSrcRecords::Parser::~Parser() {}
// Abstract parser for each source record
class Parser
{
- void *d;
+ void * const d;
protected:
const pkgIndexFile *iIndex;
private:
/** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+ void * const d;
// The list of files and the current parser pointer
std::vector<Parser*> Files;
class pkgTagFilePrivate
{
public:
- pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Buffer(NULL),
- Start(NULL), End(NULL),
- Done(false), iOffset(0),
- Size(Size)
+ void Reset(FileFd * const pFd, unsigned long long const pSize)
{
+ Fd = pFd;
+ Buffer = NULL;
+ Start = NULL;
+ End = NULL;
+ Done = false;
+ iOffset = 0;
+ Size = pSize;
}
- FileFd &Fd;
+
+ pkgTagFilePrivate(FileFd * const pFd, unsigned long long const Size)
+ {
+ Reset(pFd, Size);
+ }
+ FileFd * Fd;
char *Buffer;
char *Start;
char *End;
// TagFile::pkgTagFile - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long long Size)
- : d(NULL)
+pkgTagFile::pkgTagFile(FileFd * const pFd,unsigned long long const Size)
+ : d(new pkgTagFilePrivate(pFd, Size + 4))
{
Init(pFd, Size);
}
-
-void pkgTagFile::Init(FileFd *pFd,unsigned long long Size)
+void pkgTagFile::Init(FileFd * const pFd,unsigned long long Size)
{
/* The size is increased by 4 because if we start with the Size of the
filename we need to try to read 1 char more to see an EOF faster, 1
char the end-pointer can be on and maybe 2 newlines need to be added
to the end of the file -> 4 extra chars */
Size += 4;
- if(d != NULL)
- {
- free(d->Buffer);
- delete d;
- }
- d = new pkgTagFilePrivate(pFd, Size);
+ d->Reset(pFd, Size);
- if (d->Fd.IsOpen() == false)
+ if (d->Fd->IsOpen() == false)
d->Start = d->End = d->Buffer = 0;
else
d->Buffer = (char*)malloc(sizeof(char) * Size);
if (Resize() == false)
return _error->Error(_("Unable to parse package file %s (%d)"),
- d->Fd.Name().c_str(), 1);
+ d->Fd->Name().c_str(), 1);
} while (Tag.Scan(d->Start,d->End - d->Start, false) == false);
}
{
// See if only a bit of the file is left
unsigned long long const dataSize = d->Size - ((d->End - d->Buffer) + 1);
- if (d->Fd.Read(d->End, dataSize, &Actual) == false)
+ if (d->Fd->Read(d->End, dataSize, &Actual) == false)
return false;
if (Actual != dataSize)
d->Done = true;
// Reposition and reload..
d->iOffset = Offset;
d->Done = false;
- if (d->Fd.Seek(Offset) == false)
+ if (d->Fd->Seek(Offset) == false)
return false;
d->End = d->Start = d->Buffer;
return false;
if (Tag.Scan(d->Start, d->End - d->Start, false) == false)
- return _error->Error(_("Unable to parse package file %s (%d)"),d->Fd.Name().c_str(), 2);
+ return _error->Error(_("Unable to parse package file %s (%d)"),d->Fd->Name().c_str(), 2);
return true;
}
/* */
APT_IGNORE_DEPRECATED_PUSH
pkgTagSection::pkgTagSection()
- : Section(0), d(NULL), Stop(0)
+ : Section(0), d(new pkgTagSectionPrivate()), Stop(0)
{
- d = new pkgTagSectionPrivate();
#if APT_PKG_ABI < 413
TagCount = 0;
memset(&Indexes, 0, sizeof(Indexes));
APT_DEPRECATED unsigned int TagCount;
#endif
- pkgTagSectionPrivate *d;
+ pkgTagSectionPrivate * const d;
protected:
const char *Stop;
class pkgTagFilePrivate;
class pkgTagFile
{
- pkgTagFilePrivate *d;
+ pkgTagFilePrivate * const d;
APT_HIDDEN bool Fill();
APT_HIDDEN bool Resize();
unsigned long Offset();
bool Jump(pkgTagSection &Tag,unsigned long long Offset);
- void Init(FileFd *F,unsigned long long Size = 32*1024);
+ void Init(FileFd * const F,unsigned long long const Size = 32*1024);
- pkgTagFile(FileFd *F,unsigned long long Size = 32*1024);
+ pkgTagFile(FileFd * const F,unsigned long long Size = 32*1024);
virtual ~pkgTagFile();
};