#include <Notes.h>

Inheritance diagram for Notes:
Collaboration diagram for Notes:

Public Types

typedef RefCount< NotesPointer
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 char **metasBlacklist, bool allowFormatted=true)
 Notes ()
 ~Notes ()
 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="\") const
void updateNotePairs (NotePairsPointer pairs, const CharacterSet *delimiters, const AccessLogEntryPointer &al)

Private Member Functions

void validateKey (const SBuf &key) const
Note::Pointer add (const SBuf &noteKey)
Note::Pointer find (const SBuf &noteKey)

Private Attributes

NotesList notes
 The Note::Pointer objects array list. More...
const char * descr
 A short description for notes list. More...
const char ** blacklisted
 Null terminated list of blacklisted note keys. More...
bool formattedValues
 Whether the formatted values are supported. 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 114 of file Notes.h.

◆ iterator

typedef NotesList::iterator Notes::iterator

Definition at line 113 of file Notes.h.

◆ NotesList

Definition at line 112 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 char **  metasBlacklist,
bool  allowFormatted = true 

Definition at line 116 of file Notes.h.

◆ Notes() [2/3]

Notes::Notes ( )

Definition at line 117 of file Notes.h.

◆ ~Notes()

Notes::~Notes ( )

Definition at line 118 of file Notes.h.

References Note::dump(), Note::Value::operator=(), and parse().

◆ Notes() [3/3]

Notes::Notes ( const Notes )

Member Function Documentation

◆ add()

Note::Pointer Notes::add ( const SBuf noteKey)

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 128 of file Notes.cc.

References Note::Value::Note, and p.

◆ begin()

iterator Notes::begin ( )

Definition at line 134 of file Notes.h.

◆ clean()

void Notes::clean ( )

Definition at line 131 of file Notes.h.

Referenced by free_note().

◆ dump()

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

Definition at line 223 of file Notes.cc.

Referenced by dump_note().

◆ empty()

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

Definition at line 138 of file Notes.h.

References Note::key(), Note::toString(), and Note::updateNotePairs().

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

◆ end()

iterator Notes::end ( )

Definition at line 136 of file Notes.h.

◆ find()

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

Definition at line 137 of file Notes.cc.

◆ operator=()

Notes& Notes::operator= ( const Notes )

◆ parse()

◆ parseKvPair()

◆ 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 230 of file Notes.cc.

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

Referenced by ACLAnnotationData::dump().

◆ updateNotePairs()

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

Definition at line 216 of file Notes.cc.

Referenced by ACLAnnotationData::annotate().

◆ validateKey()

void Notes::validateKey ( const SBuf key) const

Verifies that the key is not blacklisted (fatal error) and does not contain special characters (non-fatal error). If keyLen is not provided, the key is assumed null-terminated.

Definition at line 146 of file Notes.cc.

References CharacterSet::ALPHA, cfg_filename, SBuf::cmp(), config_lineno, DBG_CRITICAL, debugs, CharacterSet::DIGIT, fatalf(), SBuf::findFirstNotOf(), i, SBuf::length(), SBuf::npos, and SBuf::rawContent().

Member Data Documentation

◆ blacklisted

const char** Notes::blacklisted

Definition at line 160 of file Notes.h.

◆ descr

const char* Notes::descr

Definition at line 159 of file Notes.h.

◆ formattedValues

bool Notes::formattedValues

Definition at line 161 of file Notes.h.

◆ notes

NotesList Notes::notes

Definition at line 158 of file Notes.h.

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






Web Site Translations