#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 dump (StoreEntry *entry, const char *name)
 Dump the notes list to the given StoreEntry object. 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
 
const char * toString (const char *sep="\r\n") 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 108 of file Notes.h.

Member Typedef Documentation

◆ const_iterator

typedef NotesList::const_iterator Notes::const_iterator

Definition at line 115 of file Notes.h.

◆ iterator

typedef NotesList::iterator Notes::iterator

Definition at line 114 of file Notes.h.

◆ Keys

Definition at line 112 of file Notes.h.

◆ NotesList

Definition at line 113 of file Notes.h.

◆ Pointer

Definition at line 111 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 150 of file Notes.cc.

References reservedKeys.

◆ Notes() [2/3]

Notes::Notes ( )
default

◆ ~Notes()

Notes::~Notes ( )
inlineoverride

Definition at line 119 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 159 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 177 of file Notes.cc.

References descr, Here, and ToSBuf().

Referenced by validateKey().

◆ begin()

iterator Notes::begin ( )
inline

Definition at line 135 of file Notes.h.

References notes.

◆ clean()

void Notes::clean ( )
inline

Definition at line 132 of file Notes.h.

References notes.

Referenced by free_note().

◆ dump()

void Notes::dump ( StoreEntry entry,
const char *  name 
)

Definition at line 255 of file Notes.cc.

References notes.

Referenced by dump_note().

◆ empty()

bool Notes::empty ( ) const
inline
Returns
true if the notes list is empty

Definition at line 139 of file Notes.h.

References notes.

Referenced by accessLogInit(), and ACLAnnotationData::empty().

◆ end()

iterator Notes::end ( )
inline

Definition at line 137 of file Notes.h.

References notes.

◆ find()

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

Definition at line 168 of file Notes.cc.

References notes.

Referenced by add(), and parseKvPair().

◆ operator=()

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

◆ parse()

◆ parseKvPair()

◆ ReservedKeys()

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

Definition at line 129 of file Notes.cc.

References keys.

Referenced by validateKey().

◆ toString()

const char * Notes::toString ( const char *  sep = "\r\n") const

Convert Notes list to a string consist of "Key: Value" entries separated by sep string.

Definition at line 262 of file Notes.cc.

References SBuf::append(), SBuf::c_str(), SBuf::clear(), SBuf::isEmpty(), and notes.

Referenced by ACLAnnotationData::dump().

◆ updateNotePairs()

void Notes::updateNotePairs ( NotePairsPointer  pairs,
const CharacterSet delimiters,
const AccessLogEntryPointer al 
)

Definition at line 248 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 184 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 161 of file Notes.h.

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

◆ formattedValues

bool Notes::formattedValues = false
private

Definition at line 164 of file Notes.h.

Referenced by parse(), and parseKvPair().

◆ notes

NotesList Notes::notes
private

Definition at line 160 of file Notes.h.

Referenced by ~Notes(), add(), begin(), clean(), dump(), empty(), end(), find(), toString(), and updateNotePairs().

◆ reservedKeys

Keys Notes::reservedKeys
private

Definition at line 163 of file Notes.h.

Referenced by Notes(), and validateKey().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors