48 unsigned int AlphaIndexes[128];
49 unsigned int BetaIndexes[128];
51 std::unique_ptr<pkgTagSectionPrivate>
const d;
53 APT_HIDDEN
bool FindInternal(
unsigned int Pos,
const char *&Start,
const char *&End)
const;
54 APT_HIDDEN std::string_view FindInternal(
unsigned int Pos)
const;
55 APT_HIDDEN std::string_view FindRawInternal(
unsigned int Pos)
const;
56 APT_HIDDEN
signed int FindIInternal(
unsigned int Pos,
signed long Default = 0)
const;
57 APT_HIDDEN
bool FindBInternal(
unsigned int Pos,
bool Default =
false)
const;
58 APT_HIDDEN
unsigned long long FindULLInternal(
unsigned int Pos,
unsigned long long const &Default = 0)
const;
59 APT_HIDDEN
bool FindFlagInternal(
unsigned int Pos,uint8_t &Flags, uint8_t
const Flag)
const;
60 APT_HIDDEN
bool FindFlagInternal(
unsigned int Pos,
unsigned long &Flags,
unsigned long Flag)
const;
67 inline bool operator ==(
const pkgTagSection &rhs) {
return Section == rhs.Section;};
68 inline bool operator !=(
const pkgTagSection &rhs) {
return Section != rhs.Section;};
71 std::string FindS(std::string_view sv)
const {
return std::string{Find(sv)}; }
72 std::string FindRawS(std::string_view sv)
const {
return std::string{FindRaw(sv)}; };
76#ifdef APT_COMPILING_APT
77 bool Find(Key key,
const char *&Start,
const char *&End)
const;
78 bool Find(Key key,
unsigned int &Pos)
const;
79 signed int FindI(Key key,
signed long Default = 0)
const;
80 bool FindB(Key key,
bool Default =
false)
const;
81 unsigned long long FindULL(Key key,
unsigned long long const &Default = 0)
const;
82 bool FindFlag(Key key,uint8_t &Flags, uint8_t
const Flag)
const;
83 bool FindFlag(Key key,
unsigned long &Flags,
unsigned long Flag)
const;
84 bool Exists(Key key)
const;
85 std::string_view Find(Key key)
const;
86 std::string_view FindRaw(Key key)
const;
89 bool Find(std::string_view
Tag,
const char *&Start,
const char *&End)
const;
90 bool Find(std::string_view
Tag,
unsigned int &Pos)
const;
91 std::string_view Find(std::string_view
Tag)
const;
92 std::string_view FindRaw(std::string_view
Tag)
const;
93 signed int FindI(std::string_view
Tag,
signed long Default = 0)
const;
94 bool FindB(std::string_view,
bool Default =
false)
const;
95 unsigned long long FindULL(std::string_view
Tag,
unsigned long long const &Default = 0)
const;
97 bool FindFlag(std::string_view
Tag,uint8_t &Flags,
98 uint8_t
const Flag)
const;
99 bool FindFlag(std::string_view
Tag,
unsigned long &Flags,
100 unsigned long Flag)
const;
101 bool Exists(std::string_view
Tag)
const;
103 bool static FindFlag(uint8_t &Flags, uint8_t
const Flag,
104 const char*
const Start,
const char*
const Stop);
105 bool static FindFlag(
unsigned long &Flags,
unsigned long Flag,
106 const char* Start,
const char* Stop);
124 [[nodiscard]]
bool Scan(
const char *Start,
unsigned long MaxLength,
bool const Restart =
true);
126 inline unsigned long size()
const {
return Stop - Section;};
128 virtual void TrimRecord(
bool BeforeRecord,
const char* &End);
135 unsigned int Count()
const;
137 void Get(
const char *&Start,
const char *&Stop,
unsigned int I)
const;
139 inline void GetSection(
const char *&Start,
const char *&Stop)
const
150 enum ActionType { REMOVE, RENAME, REWRITE } Action;
154 static Tag Remove(std::string_view Name);
155 static Tag Rename(std::string_view OldName, std::string_view NewName);
156 static Tag Rewrite(std::string_view Name, std::string_view Data);
158 Tag(ActionType
const Action, std::string_view Name, std::string_view Data) :
159 Action(Action), Name(Name), Data(Data) {}
169 bool Write(
FileFd &File,
char const *
const *
const Order = NULL, std::vector<Tag>
const &Rewrite = std::vector<Tag>())
const;
170#ifdef APT_COMPILING_APT
174 WRITE_HUMAN = (1 << 0),
176 bool Write(
FileFd &File, WriteFlags flags,
char const *
const *
const Order = NULL, std::vector<Tag>
const &Rewrite = std::vector<Tag>())
const;