#endif
class FileFd;
+class pkgTagSectionPrivate;
class pkgTagSection
{
const char *Section;
- struct TagData {
- unsigned int StartTag;
- unsigned int EndTag;
- unsigned int StartValue;
- unsigned int NextInBucket;
-
- TagData(unsigned int const StartTag) : StartTag(StartTag), NextInBucket(0) {}
- };
- std::vector<TagData> Tags;
- unsigned int LookupTable[0x100];
+ // We have a limit of 256 tags per section with the old abi
+#if APT_PKG_ABI < 413
+ APT_DEPRECATED unsigned int Indexes[256];
+#endif
+ unsigned int AlphaIndexes[0x100];
+#if APT_PKG_ABI < 413
+ APT_DEPRECATED unsigned int TagCount;
+#endif
// dpointer placeholder (for later in case we need it)
- void *d;
+ pkgTagSectionPrivate *d;
protected:
const char *Stop;
* @return \b true if section end was found, \b false otherwise.
* Beware that internal state will be inconsistent if \b false is returned!
*/
+#if APT_PKG_ABI >= 413
APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart = true);
+#else
+ APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart);
+ APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength);
+#endif
+
inline unsigned long size() const {return Stop - Section;};
void Trim();
virtual void TrimRecord(bool BeforeRecord, const char* &End);
/** \brief amount of Tags in the current section
*
* Note: if a Tag is mentioned repeatly it will be counted multiple
- * times, but only the last occurance is available via Find methods.
+ * times, but only the last occurrence is available via Find methods.
*/
unsigned int Count() const;
+#if APT_PKG_ABI >= 413
bool Exists(const char* const Tag) const;
+#else
+ bool Exists(const char* const Tag);
+#endif
- inline void Get(const char *&Start,const char *&Stop,unsigned int I) const
- {Start = Section + Tags[I].StartTag; Stop = Section + Tags[I+1].StartTag;}
+ void Get(const char *&Start,const char *&Stop,unsigned int I) const;
inline void GetSection(const char *&Start,const char *&Stop) const
{
};
pkgTagSection();
- virtual ~pkgTagSection() {};
+ virtual ~pkgTagSection();
};
class pkgTagFilePrivate;