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.

Functions

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)
 

Function Documentation

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

appends an item to the list

Definition at line 19 of file StrList.cc.

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

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

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 StrList.cc.

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

Referenced by assembleVaryKey(), Http::ContentLengthInterpreter::checkList(), HttpHeader::getByNameListMember(), HttpHeader::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().

int strListIsMember ( const String list,
const SBuf m,
char  del 
)
int strListIsSubstr ( const String list,
const char *  s,
char  del 
)

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

Note
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 StrList.cc.

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

Referenced by clientInterpretRequestHeaders().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors