|
Squid Web Cache v8/master
|
#include <Notes.h>
Public Types | |
| typedef RefCount< Notes > | Pointer |
| typedef std::vector< SBuf > | Keys |
| unordered annotation names | |
| typedef std::vector< Note::Pointer > | NotesList |
| typedef NotesList::iterator | iterator |
| iterates over the notes list | |
| typedef NotesList::const_iterator | const_iterator |
| iterates over the notes list | |
Public Member Functions | |
| Notes (const char *aDescr, const Keys *extraReservedKeys=nullptr, bool allowFormatted=true) | |
| Notes ()=default | |
| ~Notes () override | |
| Notes (const Notes &)=delete | |
| Notes & | operator= (const Notes &)=delete |
| Note::Pointer | parse (ConfigParser &parser) |
| Parses a notes line and returns a pointer to the parsed Note object. | |
| void | parseKvPair () |
| Parses an annotate line with "key=value" or "key+=value" formats. | |
| void | printAsNoteDirectives (StoreEntry *, const char *directiveName) const |
| Prints notes using "note" squid.conf directive format, one directive per stored note. | |
| void | clean () |
| clean the notes list | |
| iterator | begin () |
| points to the first argument | |
| iterator | end () |
| points to the end of list | |
| bool | empty () const |
| void | printAsAnnotationAclParameters (std::ostream &) const |
| void | updateNotePairs (NotePairsPointer pairs, const CharacterSet *delimiters, const AccessLogEntryPointer &al) |
Private Member Functions | |
| void | banReservedKey (const SBuf &key, const Keys &banned) const |
| Makes sure the given key is not on the given list of banned names. | |
| void | validateKey (const SBuf &key) const |
| Note::Pointer | add (const SBuf ¬eKey) |
| Note::Pointer | find (const SBuf ¬eKey) |
Static Private Member Functions | |
| static const Notes::Keys & | ReservedKeys () |
| always prohibited key names | |
Private Attributes | |
| NotesList | notes |
| The Note::Pointer objects array list. | |
| const char * | descr = nullptr |
| identifies note source in error messages | |
| Keys | reservedKeys |
| a list of additional prohibited key names | |
| bool | formattedValues = false |
| whether to expand quoted logformat codes | |
| typedef NotesList::const_iterator Notes::const_iterator |
| typedef NotesList::iterator Notes::iterator |
| typedef std::vector<SBuf> Notes::Keys |
| typedef std::vector<Note::Pointer> Notes::NotesList |
| typedef RefCount<Notes> Notes::Pointer |
|
explicit |
Definition at line 158 of file Notes.cc.
References reservedKeys.
|
default |
|
delete |
|
private |
Adds a note to the notes list and returns a pointer to the related Note object. If the note key already exists in list, returns a pointer to the existing object. If keyLen is not provided, the noteKey is assumed null-terminated.
Definition at line 167 of file Notes.cc.
Referenced by parse(), and parseKvPair().
|
inline |
|
inline |
Definition at line 145 of file Notes.h.
References notes.
Referenced by accessLogInit(), ACLAnnotationData::dump(), and ACLAnnotationData::empty().
|
private |
| Note::Pointer Notes::parse | ( | ConfigParser & | parser | ) |
Definition at line 210 of file Notes.cc.
References aclParseAclList(), add(), SBuf::append(), SBuf::c_str(), descr, ConfigParser::DisableMacros(), ConfigParser::EnableMacros(), fatalf(), formattedValues, ConfigParser::LastTokenWasQuoted(), ConfigParser::NextQuotedToken(), ConfigParser::NextToken(), and validateKey().
Referenced by parse_note().
| void Notes::parseKvPair | ( | ) |
Definition at line 231 of file Notes.cc.
References add(), assert, DBG_CRITICAL, debugs, descr, fatalf(), find(), formattedValues, ConfigParser::LastTokenWasQuoted(), Note::Value::mhAppend, Note::Value::mhReplace, ConfigParser::NextKvPair(), and validateKey().
Referenced by ACLAnnotationData::parse().
| void Notes::printAsAnnotationAclParameters | ( | std::ostream & | os | ) | const |
print notes using "annotate_transaction acl parameters" format, one key=value parameter per note
Definition at line 270 of file Notes.cc.
References notes.
Referenced by ACLAnnotationData::dump().
| void Notes::printAsNoteDirectives | ( | StoreEntry * | entry, |
| const char * | directiveName | ||
| ) | const |
|
staticprivate |
| void Notes::updateNotePairs | ( | NotePairsPointer | pairs, |
| const CharacterSet * | delimiters, | ||
| const AccessLogEntryPointer & | al | ||
| ) |
Definition at line 256 of file Notes.cc.
References notes.
Referenced by ACLAnnotationData::annotate().
|
private |
Verifies that the key is not reserved (fatal error) and does not contain special characters (non-fatal error).
Definition at line 192 of file Notes.cc.
References CharacterSet::ALPHA, banReservedKey(), DBG_CRITICAL, debugs, CharacterSet::DIGIT, SBuf::findFirstNotOf(), SBuf::npos, reservedKeys, and ReservedKeys().
Referenced by parse(), and parseKvPair().
|
private |
Definition at line 169 of file Notes.h.
Referenced by banReservedKey(), parse(), and parseKvPair().
|
private |
Definition at line 172 of file Notes.h.
Referenced by parse(), and parseKvPair().
|
private |
Definition at line 168 of file Notes.h.
Referenced by ~Notes(), add(), begin(), clean(), empty(), end(), find(), printAsAnnotationAclParameters(), printAsNoteDirectives(), and updateNotePairs().
|
private |
Definition at line 171 of file Notes.h.
Referenced by Notes(), and validateKey().