#include <Notes.h>


Classes | |
class | Entry |
Used to store a note key/value pair. More... | |
Public Types | |
typedef RefCount< NotePairs > | Pointer |
typedef std::vector< Entry::Pointer > | Entries |
The key/value pair entries. More... | |
Public Member Functions | |
NotePairs () | |
NotePairs & | operator= (NotePairs const &)=delete |
NotePairs (NotePairs const &)=delete | |
void | append (const NotePairs *src) |
Append the entries of the src NotePairs list to our list. More... | |
void | replaceOrAdd (const NotePairs *src) |
void | appendNewOnly (const NotePairs *src) |
bool | find (SBuf &resultNote, const char *noteKey, const char *sep=",") const |
const char * | findFirst (const char *noteKey) const |
void | add (const SBuf &key, const SBuf &value) |
void | add (const char *key, const char *value) |
void | remove (const char *key) |
void | remove (const SBuf &key) |
void | addStrList (const SBuf &key, const SBuf &values, const CharacterSet &delimiters) |
bool | hasPair (const SBuf &key, const SBuf &value) const |
const char * | toString (const char *sep="\") const |
bool | empty () const |
void | clear () |
const Entries & | expandListEntries (const CharacterSet *delimiters) const |
Private Attributes | |
Entries | entries |
The key/value pair entries. More... | |
Detailed Description
Member Typedef Documentation
◆ Entries
typedef std::vector<Entry::Pointer> NotePairs::Entries |
◆ Pointer
typedef RefCount<NotePairs> NotePairs::Pointer |
Constructor & Destructor Documentation
◆ NotePairs() [1/2]
|
inline |
Definition at line 195 of file Notes.h.
References Note::key(), Note::Value::operator=(), Note::toString(), Note::Value::value(), and Note::values.
◆ NotePairs() [2/2]
|
delete |
Member Function Documentation
◆ add() [1/2]
Adds a note key and value to the notes list. If the key name already exists in the list, add the given value to its set of values.
Definition at line 280 of file Notes.cc.
Referenced by Helper::Reply::finalize(), Adaptation::Icap::ModXact::makeRequestHeaders(), Helper::Reply::parseResponseKeys(), redirectHandleReply(), redirectStart(), Adaptation::Ecap::XactionRep::start(), storeIdStart(), Ssl::Helper::Submit(), Note::updateNotePairs(), and UpdateRequestNotes().
◆ add() [2/2]
void NotePairs::add | ( | const char * | key, |
const char * | value | ||
) |
◆ addStrList()
void NotePairs::addStrList | ( | const SBuf & | key, |
const SBuf & | values, | ||
const CharacterSet & | delimiters | ||
) |
Adds a note key and values strList to the notes list. If the key name already exists in the list, add the new values to its set of values.
Definition at line 327 of file Notes.cc.
References AppendTokens().
Referenced by Note::updateNotePairs().
◆ append()
void NotePairs::append | ( | const NotePairs * | src | ) |
Definition at line 342 of file Notes.cc.
References entries.
Referenced by Http::One::Server::buildHttpRequest(), externalAclHandleReply(), redirectHandleReply(), and ExternalACLEntry::update().
◆ appendNewOnly()
void NotePairs::appendNewOnly | ( | const NotePairs * | src | ) |
Append any new entries of the src NotePairs list to our list. Entries which already exist in the destination set are ignored.
Definition at line 349 of file Notes.cc.
References entries.
Referenced by Auth::User::absorb(), and ClientHttpRequest::initRequest().
◆ clear()
|
inline |
Definition at line 244 of file Notes.h.
Referenced by ExternalACLEntry::update().
◆ empty()
|
inline |
- Returns
- true if there are not entries in the list
Definition at line 242 of file Notes.h.
Referenced by Format::Format::assemble(), HttpRequest::hasNotes(), operator<<(), and Note::updateNotePairs().
◆ expandListEntries()
const NotePairs::Entries & NotePairs::expandListEntries | ( | const CharacterSet * | delimiters | ) | const |
If delimiters are provided, returns another Entries, converting each single multi-token pair to multiple single-token pairs; returns existing entries otherwise.
Definition at line 314 of file Notes.cc.
References AppendTokens().
Referenced by ACLNoteStrategy::matchNotes().
◆ find()
bool NotePairs::find | ( | SBuf & | resultNote, |
const char * | noteKey, | ||
const char * | sep = "," |
||
) | const |
- Parameters
-
resultNote a comma separated list of notes with key 'noteKey'.
- Returns
- true if there are entries with the given 'noteKey'. Use findFirst() instead when a unique kv-pair is needed.
Definition at line 240 of file Notes.cc.
References SBuf::append(), SBuf::clear(), SBuf::isEmpty(), and SBuf::length().
Referenced by Format::Format::assemble(), and Auth::UserRequest::denyMessageFromHelper().
◆ findFirst()
const char * NotePairs::findFirst | ( | const char * | noteKey | ) | const |
- Returns
- the first note value for this key or an empty string.
Definition at line 265 of file Notes.cc.
Referenced by ClientRequestContext::clientRedirectDone(), ClientRequestContext::clientStoreIdDone(), externalAclHandleReply(), and UpdateRequestNotes().
◆ hasPair()
- Returns
- true if the key/value pair is already stored
Definition at line 333 of file Notes.cc.
References Note::Value::value().
Referenced by Adaptation::Icap::ModXact::makeRequestHeaders(), and Adaptation::Ecap::XactionRep::start().
◆ operator=()
◆ remove() [1/2]
void NotePairs::remove | ( | const char * | key | ) |
Remove all notes with a given key. If keyLen is not provided, the key is assumed null-terminated.
Definition at line 286 of file Notes.cc.
References i.
Referenced by Note::updateNotePairs(), and UpdateRequestNotes().
◆ remove() [2/2]
◆ replaceOrAdd()
void NotePairs::replaceOrAdd | ( | const NotePairs * | src | ) |
Replace existing list entries with the src NotePairs entries. Entries which do not exist in the destination set are added.
Definition at line 358 of file Notes.cc.
References entries.
Referenced by UpdateRequestNotes().
◆ toString()
const char * NotePairs::toString | ( | const char * | sep = "\r\n" | ) | const |
Convert NotePairs list to a string consist of "Key: Value" entries separated by sep string.
Definition at line 254 of file Notes.cc.
References SBuf::appendf(), SBuf::c_str(), SBuf::clear(), and SBuf::isEmpty().
Referenced by Format::Format::assemble(), and operator<<().
Member Data Documentation
◆ entries
|
private |
Definition at line 251 of file Notes.h.
Referenced by append(), appendNewOnly(), and replaceOrAdd().
The documentation for this class was generated from the following files: