X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8d058ea53b18348f81229049a27d14282bd8d8c1..3707fd4faab3f2e2521263070b68fd0afaae2900:/apt-pkg/tagfile.h diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 118954541..77a84c832 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -1,6 +1,5 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: tagfile.h,v 1.20 2003/05/19 17:13:57 doogie Exp $ /* ###################################################################### Fast scanner for RFC-822 type header information @@ -47,8 +46,7 @@ class pkgTagSection APT_DEPRECATED unsigned int TagCount; #endif - // dpointer placeholder (for later in case we need it) - pkgTagSectionPrivate *d; + pkgTagSectionPrivate * const d; protected: const char *Stop; @@ -138,16 +136,24 @@ class pkgTagSection * * @param File to write the section to * @param Order in which tags should appear in the file - * @param Rewrite is a set of tags to be renamed, rewitten and/or removed + * @param Rewrite is a set of tags to be renamed, rewritten and/or removed * @return \b true if successful, otherwise \b false */ bool Write(FileFd &File, char const * const * const Order = NULL, std::vector const &Rewrite = std::vector()) const; }; + +/* For user generated file the parser should be a bit more relaxed in exchange + for being a bit slower to allow comments and new lines all over the place */ +class pkgUserTagSection : public pkgTagSection +{ + virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE; +}; + class pkgTagFilePrivate; class pkgTagFile { - pkgTagFilePrivate *d; + pkgTagFilePrivate * const d; APT_HIDDEN bool Fill(); APT_HIDDEN bool Resize(); @@ -159,9 +165,9 @@ class pkgTagFile 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(); };