StrList.h File Reference
#include "sbuf/forward.h"
Include dependency graph for StrList.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


void strListAdd (String *str, const char *item, char del)
int strListIsMember (const String *str, const SBuf &item, char del)
int strListIsSubstr (const String *list, const char *s, char del)
int strListGetItem (const String *str, char del, const char **item, int *ilen, const char **pos)
SBuf getListMember (const String &list, const char *key, const char delimiter)

Function Documentation

◆ getListMember()

SBuf getListMember ( const String list,
const char *  key,
const char  delimiter 

Searches for the first matching key=value pair within a delimiter-separated list of items.

the value of the found pair or an empty string.

Definition at line 135 of file

References strListGetItem().

Referenced by HttpHeader::conflictingContentLength(), HttpHeader::getByNameListMember(), ProxyProtocol::Header::getElem(), and HttpHeader::getListMember().

◆ strListAdd()

void strListAdd ( String str,
const char *  item,
char  del 

appends an item to the list

Definition at line 19 of file

References String::append(), assert, buf, String::canGrowBy(), Must, and String::size().

Referenced by HttpHeader::getList(), HttpHeader::hasNamed(), and HttpStateData::httpBuildRequestHeader().

◆ strListGetItem()

int strListGetItem ( const String str,
char  del,
const char **  item,
int ilen,
const char **  pos 

iterates through a 0-terminated string of items separated by 'del's. white space around 'del' is considered to be a part of 'del' like strtok, but preserves the source, and can iterate several strings at once

returns true if next item is found. init pos with NULL to start iteration.

Definition at line 77 of file

References assert, len, String::termedBuf(), and xisspace.

Referenced by assembleVaryKey(), authDigestLogUsername(), Http::ContentLengthInterpreter::checkList(), getListMember(), HttpHeader::hasByNameListMember(), HttpHeader::hasListMember(), StoreEntry::hasOneOfEtags(), HttpHdrSc::parse(), HttpHdrCc::parse(), Adaptation::Icap::Options::TransferList::parse(), HttpHdrRange::parseInit(), HttpReply::removeStaleWarningValues(), Adaptation::DynamicServiceChain::Split(), and strListIsMember().

◆ strListIsMember()

int strListIsMember ( const String list,
const SBuf m,
char  del 

◆ strListIsSubstr()

int strListIsSubstr ( const String list,
const char *  s,
char  del 

returns true iff "s" is a substring of a member of the list

Note: the original code with a loop is broken because it uses strstr() instead of strnstr(). If 's' contains a 'del', strListIsSubstr() may return true when it should not. If 's' does not contain a 'del', the implementaion is equavalent to strstr()! Thus, we replace the loop with strstr() above until strnstr() is available.

Definition at line 54 of file

References assert, String::find(), and String::npos.

Referenced by clientInterpretRequestHeaders().






Web Site Translations