#include <wvstring.h>
We can instantiate a temporary WvStringStar, which can then return its 'this' pointer.
Definition at line 414 of file wvstring.h.
Public Member Functions | |
WvStringStar (WvStringParm s) | |
WvFastString * | operator-> () |
void | setsize (size_t i) |
size_t | len () const |
bool | operator== (WvStringParm s2) const |
bool | operator== (const char *s2) const |
bool | operator!= (WvStringParm s2) const |
bool | operator!= (const char *s2) const |
bool | operator< (WvStringParm s2) const |
bool | operator< (const char *s2) const |
bool | operator! () const |
the not operator is 'true' if string is empty | |
const char * | operator+ (int i) const |
const char * | operator- (int i) const |
operator const char * () const | |
auto-convert WvString to (const char *), when needed. | |
const char * | cstr () const |
return a (const char *) for this string. | |
operator QString () const | |
return a Qt library QString containing the contents of this string. | |
int | num () const |
Return a stdc++ string with the contents of this string. | |
bool | isnull () const |
returns true if this string is null | |
const WvFastString & | ifnull (WvStringParm defval) const |
returns either this string, or, if isnull(), the given string. | |
Static Public Member Functions | |
static void | do_format (WvFastString &output, const char *format, const WvFastString *const *a) |
when this is called, we assume output.str == NULL; it will be filled. | |
Static Public Attributes | |
static const WvFastString | null |
Protected Member Functions | |
void | construct (const char *_str) |
void | link (WvStringBuf *_buf, const char *_str) |
void | unlink () |
WvStringBuf * | alloc (size_t size) |
void | newbuf (size_t size) |
Protected Attributes | |
WvStringBuf * | buf |
char * | str |
Static Protected Attributes | |
static WvStringBuf | nullbuf = { 0, 1 } |
void WvFastString::do_format | ( | WvFastString & | output, | |
const char * | format, | |||
const WvFastString *const * | argv | |||
) | [static, inherited] |
when this is called, we assume output.str == NULL; it will be filled.
Accept a printf-like format specifier (but more limited) and an array of WvStrings, and render them into another WvString.
For example: WvString x[] = {"foo", "blue", 1234}; WvString ret = WvString::do_format("%s%10.2s%-10s", x);
The 'ret' string will be: "foo bl1234 " Note that only 's' is supported, though integers can be rendered automatically into WvStrings. d, f, etc are not allowed!
This function is usually called from some other function which allocates the array automatically.
%$ns (n > 0) is also supported for internationalization purposes. e.g. ("%$2s is arg2, and %$1s ia arg1", arg1, arg2)
Definition at line 488 of file wvstring.cc.
References WvFastString::cstr(), WvFastString::setsize(), and WvFastString::str.
Referenced by WvFastString::WvFastString().
WvFastString::operator const char * | ( | ) | const [inline, inherited] |
auto-convert WvString to (const char *), when needed.
Definition at line 253 of file wvstring.h.
References WvFastString::str.
const char* WvFastString::cstr | ( | ) | const [inline, inherited] |
return a (const char *) for this string.
The typecast operator does this automatically when needed, but sometimes (especially with varargs like in printf()) that isn't convenient enough.
Definition at line 261 of file wvstring.h.
References WvFastString::str.
Referenced by WvBackslashEncoder::_encode(), UniListIter::add(), WvConfEmu::add_callback(), WvMonikerRegistry::create(), WvCRLMgr::decode(), WvConfEmu::del_callback(), UniReplicateGen::deltacallback(), WvFastString::do_format(), WvLogBuffer::feed_receiver(), WvConfEmu::get(), WvConfigSectionEmu::get(), UniRetryGen::get(), UniRegistryGen::get(), UniPStoreGen::get(), UniConfKey::hastrailingslash(), WvFastString::operator QString(), WvArgsData::parser(), WvBufBase< unsigned char >::putstr(), UniClientConn::readcmd(), UniReplicateGen::replicate(), WvConstStringBuffer::reset(), WvStringMask::set(), UniReplicateGen::set(), UniRegistryGen::set(), UniPStoreGen::set(), UniConfGen::str2int(), substr(), WvX509Mgr::unhexify(), UniRetryGen::UniRetryGen(), WvLog::uwrite(), WvStream::write(), and WvTaskMan::yield().
WvFastString::operator QString | ( | ) | const [inherited] |
return a Qt library QString containing the contents of this string.
You need to link to libwvqt.so if you use this.
Definition at line 42 of file wvqtstring.cc.
References WvFastString::cstr().
int WvFastString::num | ( | ) | const [inline, inherited] |
Return a stdc++ string with the contents of this string.
To use this, include wvstdstring.h. used to convert WvString to int, when needed. we no longer provide a typecast, because it causes annoyance.
Definition at line 280 of file wvstring.h.
References WvFastString::str.
Referenced by WvDaemon::do_load(), UniConfDaemonConn::execute(), and WvIPRouteList::get_kernel().
const WvFastString& WvFastString::ifnull | ( | WvStringParm | defval | ) | const [inline, inherited] |
returns either this string, or, if isnull(), the given string.
Definition at line 288 of file wvstring.h.
References WvFastString::isnull().