SquidString.h
Go to the documentation of this file.
122 static bool CanGrowTo(size_type totalLen, const size_type extras = 0) { return SafeAdd(totalLen, extras) && SafeAdd(totalLen, 1); }
145 static bool SafeAdd(size_type &base, size_type extra) { if (extra <= SizeMax_ && base <= SizeMax_ - extra) { base += extra; return true; } return false; }
std::ostream & operator<<(std::ostream &os, String const &aString)
Definition: SquidString.h:163
Definition: SquidString.h:26
bool canGrowBy(const size_type growthLen) const
whether appending growthLen characters is safe (i.e., unlikely to assert)
Definition: SquidString.h:124
String()=default
static bool SafeAdd(size_type &base, size_type extra)
returns true after increasing the first argument by extra if the sum does not exceed SizeMax_
Definition: SquidString.h:145
static bool CanGrowTo(size_type totalLen, const size_type extras=0)
Definition: SquidString.h:122