SBuf.h File Reference
#include "base/InstanceId.h"
#include "base/TextException.h"
#include "debug/Stream.h"
#include "globals.h"
#include "sbuf/forward.h"
#include "sbuf/MemBlob.h"
#include "sbuf/Stats.h"
#include <climits>
#include <iosfwd>
#include <iterator>
Include dependency graph for SBuf.h:

Go to the source code of this file.

Classes

class  SBufIterator
 
class  SBufReverseIterator
 
class  SBuf
 
class  SBuf::Locker
 
class  SBufReservationRequirements
 Named SBuf::reserve() parameters. Defaults ask for and restrict nothing. More...
 

Macros

#define SQUIDSBUFPH   "%.*s"
 
#define SQUIDSBUFPRINT(s)   (s).plength(),(s).rawContent()
 

Enumerations

enum  SBufCaseSensitive {
  caseSensitive ,
  caseInsensitive
}
 

Functions

std::ostream & operator<< (std::ostream &os, const SBuf &S)
 ostream output operator More...
 
SBuf ToUpper (SBuf buf)
 Returns a lower-cased copy of its parameter. More...
 
SBuf ToLower (SBuf buf)
 Returns an upper-cased copy of its parameter. More...
 
void SBufToCstring (char *d, const SBuf &s)
 
char * SBufToCstring (const SBuf &s)
 

Macro Definition Documentation

◆ SQUIDSBUFPH

#define SQUIDSBUFPH   "%.*s"

Definition at line 31 of file SBuf.h.

◆ SQUIDSBUFPRINT

#define SQUIDSBUFPRINT (   s)    (s).plength(),(s).rawContent()

Definition at line 32 of file SBuf.h.

Enumeration Type Documentation

◆ SBufCaseSensitive

Enumerator
caseSensitive 
caseInsensitive 

Definition at line 36 of file SBuf.h.

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const SBuf S 
)
inline

Definition at line 713 of file SBuf.h.

References SBuf::print().

◆ SBufToCstring() [1/2]

void SBufToCstring ( char *  d,
const SBuf s 
)
inline

Copy an SBuf into a C-string.

Guarantees that the output is a c-string of length no more than SBuf::length()+1 by appending a \0 byte to the C-string copy of the SBuf contents.

Note
The destination c-string memory MUST be of at least length()+1 bytes.

No protection is added to prevent \0 bytes within the string. Unexpectedly short strings are a problem for the receiver to deal with if it cares.

Unlike SBuf::c_str() does not alter the SBuf in any way.

Definition at line 752 of file SBuf.h.

References SBuf::copy(), DBG_DATA, debugs, and SBuf::length().

Referenced by ConnStateData::buildFakeRequest(), ClientRequestContext::clientAccessCheckDone(), Acl::FinalizedParameterizedNode< Parent >::FinalizePoolLabel(), ftpReadType(), ftpTrySlashHack(), Http::One::Parser::getHostHeaderField(), Acl::UrlCheck::match(), Acl::UrlPathCheck::match(), AnyP::Uri::parse(), ConnStateData::parseHttpRequest(), ClientHttpRequest::resetRequestXXX(), SBufToCstring(), and urnParseReply().

◆ SBufToCstring() [2/2]

char * SBufToCstring ( const SBuf s)
inline

Copy an SBuf into a C-string.

See also
SBufToCstring(char *d, const SBuf &s)
Returns
A dynamically allocated c-string based on SBuf. Use xfree() / safe_free() to release the c-string.

Definition at line 768 of file SBuf.h.

References SBuf::length(), SBufToCstring(), and xmalloc.

◆ ToLower()

SBuf ToLower ( SBuf  buf)
inline

Definition at line 729 of file SBuf.h.

References SBuf::toLower().

Referenced by TestSBuf::testStringOps().

◆ ToUpper()

SBuf ToUpper ( SBuf  buf)
inline

Definition at line 721 of file SBuf.h.

References SBuf::toUpper().

Referenced by parse_port_option(), and TestSBuf::testStartsWith().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors