From 1abbce9eafbba7a6fd22bd6ddd9287e97113fc87 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jan 2011 22:22:51 +0100 Subject: apt-pkg/tagfile.{cc,h}: add dpointer to pkgTagFile --- apt-pkg/tagfile.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'apt-pkg/tagfile.h') diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 6891c1d81..60d3c2cd0 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -23,16 +23,17 @@ #include #include - + class pkgTagSection { const char *Section; - // We have a limit of 256 tags per section. unsigned int Indexes[256]; unsigned int AlphaIndexes[0x100]; - unsigned int TagCount; + int *reserved1; + int *reserved2; + int *reserved3; /* This very simple hash function for the last 8 letters gives very good performance on the debian package files */ @@ -44,7 +45,6 @@ class pkgTagSection return Res & 0xFF; } - protected: const char *Stop; @@ -80,15 +80,10 @@ class pkgTagSection pkgTagSection() : Section(0), Stop(0) {}; }; +class pkgTagFilePrivate; class pkgTagFile { - FileFd &Fd; - char *Buffer; - char *Start; - char *End; - bool Done; - unsigned long iOffset; - unsigned long Size; + pkgTagFilePrivate *d; bool Fill(); bool Resize(); @@ -96,7 +91,7 @@ class pkgTagFile public: bool Step(pkgTagSection &Section); - inline unsigned long Offset() {return iOffset;}; + inline unsigned long Offset(); bool Jump(pkgTagSection &Tag,unsigned long Offset); pkgTagFile(FileFd *F,unsigned long Size = 32*1024); -- cgit v1.2.3 From 4b2746d5ff7d6c5ed3b23a44a67fc323475cfd7d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jan 2011 22:26:56 +0100 Subject: apt-pkg/tagfile.{cc,h}: add comment, remove "inline" from pkgTagFile::Offset() --- apt-pkg/tagfile.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt-pkg/tagfile.h') diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 60d3c2cd0..68f1642d9 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -31,9 +31,11 @@ class pkgTagSection unsigned int Indexes[256]; unsigned int AlphaIndexes[0x100]; unsigned int TagCount; + // for later int *reserved1; int *reserved2; int *reserved3; + int *reserved4; /* This very simple hash function for the last 8 letters gives very good performance on the debian package files */ @@ -91,7 +93,7 @@ class pkgTagFile public: bool Step(pkgTagSection &Section); - inline unsigned long Offset(); + unsigned long Offset(); bool Jump(pkgTagSection &Tag,unsigned long Offset); pkgTagFile(FileFd *F,unsigned long Size = 32*1024); -- cgit v1.2.3 From 43fb90dcd5d3f8887c1903073ad21a53847974ba Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 28 Jan 2011 20:55:45 +0100 Subject: apt-pkg/tagfile.h: add dpointer placeholder, make destructor virtual; apt-pkg/deb/debsystem.h: make destructor virtual --- apt-pkg/tagfile.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'apt-pkg/tagfile.h') diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 68f1642d9..f361a787f 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -31,11 +31,8 @@ class pkgTagSection unsigned int Indexes[256]; unsigned int AlphaIndexes[0x100]; unsigned int TagCount; - // for later - int *reserved1; - int *reserved2; - int *reserved3; - int *reserved4; + // dpointer placeholder (for later in case we need it) + void *d; /* This very simple hash function for the last 8 letters gives very good performance on the debian package files */ @@ -80,6 +77,7 @@ class pkgTagSection }; pkgTagSection() : Section(0), Stop(0) {}; + virtual ~pkgTagSection() {}; }; class pkgTagFilePrivate; @@ -97,7 +95,7 @@ class pkgTagFile bool Jump(pkgTagSection &Tag,unsigned long Offset); pkgTagFile(FileFd *F,unsigned long Size = 32*1024); - ~pkgTagFile(); + virtual ~pkgTagFile(); }; /* This is the list of things to rewrite. The rewriter -- cgit v1.2.3