Squid Web Cache v8/master
Loading...
Searching...
No Matches
StringConvert.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_SBUF_STRINGCONVERT_H
10#define SQUID_SRC_SBUF_STRINGCONVERT_H
11
12#include "sbuf/SBuf.h"
13#include "SquidString.h"
14
16inline SBuf
18{
19 return SBuf(s.rawBuf(), s.size());
20}
21
25inline String
27{
28 String rv;
29 rv.assign(s.rawContent(), s.length());
30 return rv;
31}
32
33#endif /* SQUID_SRC_SBUF_STRINGCONVERT_H */
34
String SBufToString(const SBuf &s)
SBuf StringToSBuf(const String &s)
create a new SBuf from a String by copying contents
Definition SBuf.h:94
const char * rawContent() const
Definition SBuf.cc:509
size_type length() const
Returns the number of bytes stored in SBuf.
Definition SBuf.h:419
void assign(const char *str, int len)
Definition String.cc:79
char const * rawBuf() const
Definition SquidString.h:87
size_type size() const
Definition SquidString.h:74