#include <Notes.h>
![Inheritance graph](classNotes__inherit__graph.png)
![Collaboration graph](classNotes__coll__graph.png)
Public Types | |
typedef RefCount< Notes > | Pointer |
typedef std::vector< SBuf > | Keys |
unordered annotation names More... | |
typedef std::vector< Note::Pointer > | NotesList |
typedef NotesList::iterator | iterator |
iterates over the notes list More... | |
typedef NotesList::const_iterator | const_iterator |
iterates over the notes list More... | |
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. More... | |
void | parseKvPair () |
Parses an annotate line with "key=value" or "key+=value" formats. More... | |
void | printAsNoteDirectives (StoreEntry *, const char *directiveName) const |
Prints notes using "note" squid.conf directive format, one directive per stored note. More... | |
void | clean () |
clean the notes list More... | |
iterator | begin () |
points to the first argument More... | |
iterator | end () |
points to the end of list More... | |
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. More... | |
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 More... | |
Private Attributes | |
NotesList | notes |
The Note::Pointer objects array list. More... | |
const char * | descr = nullptr |
identifies note source in error messages More... | |
Keys | reservedKeys |
a list of additional prohibited key names More... | |
bool | formattedValues = false |
whether to expand quoted logformat codes More... | |
Detailed Description
Member Typedef Documentation
◆ const_iterator
typedef NotesList::const_iterator Notes::const_iterator |
◆ iterator
typedef NotesList::iterator Notes::iterator |
◆ Keys
typedef std::vector<SBuf> Notes::Keys |
◆ NotesList
typedef std::vector<Note::Pointer> Notes::NotesList |
◆ Pointer
typedef RefCount<Notes> Notes::Pointer |
Constructor & Destructor Documentation
◆ Notes() [1/3]
|
explicit |
Definition at line 158 of file Notes.cc.
References reservedKeys.
◆ Notes() [2/3]
|
default |
◆ ~Notes()
◆ Notes() [3/3]
|
delete |
Member Function Documentation
◆ add()
|
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().
◆ banReservedKey()
◆ begin()
◆ clean()
|
inline |
◆ empty()
|
inline |
- Returns
- true if the notes list is empty
Definition at line 144 of file Notes.h.
References notes.
Referenced by accessLogInit(), ACLAnnotationData::dump(), and ACLAnnotationData::empty().
◆ end()
◆ find()
|
private |
◆ operator=()
◆ parse()
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().
◆ parseKvPair()
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().
◆ printAsAnnotationAclParameters()
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().
◆ printAsNoteDirectives()
void Notes::printAsNoteDirectives | ( | StoreEntry * | entry, |
const char * | directiveName | ||
) | const |
◆ ReservedKeys()
|
staticprivate |
◆ updateNotePairs()
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().
◆ validateKey()
|
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().
Member Data Documentation
◆ descr
|
private |
Definition at line 168 of file Notes.h.
Referenced by banReservedKey(), parse(), and parseKvPair().
◆ formattedValues
|
private |
Definition at line 171 of file Notes.h.
Referenced by parse(), and parseKvPair().
◆ notes
|
private |
Definition at line 167 of file Notes.h.
Referenced by add(), begin(), clean(), empty(), end(), find(), printAsAnnotationAclParameters(), printAsNoteDirectives(), updateNotePairs(), and ~Notes().
◆ reservedKeys
|
private |
Definition at line 170 of file Notes.h.
Referenced by Notes(), and validateKey().
The documentation for this class was generated from the following files:
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products