#include <Notes.h>

Inheritance diagram for Notes:
Collaboration diagram for Notes:

Public Types

typedef RefCount< NotesPointer
 
typedef std::vector< SBufKeys
 unordered annotation names More...
 
typedef std::vector< Note::PointerNotesList
 
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
 
Notesoperator= (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 &noteKey)
 
Note::Pointer find (const SBuf &noteKey)
 

Static Private Member Functions

static const Notes::KeysReservedKeys ()
 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

Used to store a notes configuration list.

Definition at line 112 of file Notes.h.

Member Typedef Documentation

◆ const_iterator

typedef NotesList::const_iterator Notes::const_iterator

Definition at line 119 of file Notes.h.

◆ iterator

typedef NotesList::iterator Notes::iterator

Definition at line 118 of file Notes.h.

◆ Keys

Definition at line 116 of file Notes.h.

◆ NotesList

Definition at line 117 of file Notes.h.

◆ Pointer

Definition at line 115 of file Notes.h.

Constructor & Destructor Documentation

◆ Notes() [1/3]

Notes::Notes ( const char *  aDescr,
const Keys extraReservedKeys = nullptr,
bool  allowFormatted = true 
)
explicit

Definition at line 158 of file Notes.cc.

References reservedKeys.

◆ Notes() [2/3]

Notes::Notes ( )
default

◆ ~Notes()

Notes::~Notes ( )
inlineoverride

Definition at line 123 of file Notes.h.

References notes.

◆ Notes() [3/3]

Notes::Notes ( const Notes )
delete

Member Function Documentation

◆ add()

Note::Pointer Notes::add ( const SBuf noteKey)
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.

References find(), and notes.

Referenced by parse(), and parseKvPair().

◆ banReservedKey()

void Notes::banReservedKey ( const SBuf key,
const Keys banned 
) const
private

Definition at line 185 of file Notes.cc.

References descr, Here, and ToSBuf().

Referenced by validateKey().

◆ begin()

iterator Notes::begin ( )
inline

Definition at line 140 of file Notes.h.

References notes.

◆ clean()

void Notes::clean ( )
inline

Definition at line 137 of file Notes.h.

References notes.

Referenced by free_note().

◆ empty()

bool Notes::empty ( ) const
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()

iterator Notes::end ( )
inline

Definition at line 142 of file Notes.h.

References notes.

◆ find()

Note::Pointer Notes::find ( const SBuf noteKey)
private

Definition at line 176 of file Notes.cc.

References notes.

Referenced by add(), and parseKvPair().

◆ operator=()

Notes& Notes::operator= ( const Notes )
delete

◆ parse()

◆ parseKvPair()

◆ 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

Definition at line 263 of file Notes.cc.

References notes.

Referenced by dump_note().

◆ ReservedKeys()

const Notes::Keys & Notes::ReservedKeys ( )
staticprivate

Definition at line 137 of file Notes.cc.

References keys.

Referenced by validateKey().

◆ 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()

void Notes::validateKey ( const SBuf key) const
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

const char* Notes::descr = nullptr
private

Definition at line 168 of file Notes.h.

Referenced by banReservedKey(), parse(), and parseKvPair().

◆ formattedValues

bool Notes::formattedValues = false
private

Definition at line 171 of file Notes.h.

Referenced by parse(), and parseKvPair().

◆ notes

NotesList Notes::notes
private

◆ reservedKeys

Keys 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

Documentation

Support

Miscellaneous