Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

WvStringStar Class Reference

#include <wvstring.h>

Inheritance diagram for WvStringStar:

[legend]
List of all members.

Detailed Description

A ridiculous class needed because UniConf::operator->() needs to return a pointer, even though that pointer is going to be dereferenced immediately anyway.

We can instantiate a temporary WvStringStar, which can then return its 'this' pointer.


Public Member Functions

 WvStringStar (WvStringParm s)
WvFastStringoperator-> ()
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
 used to convert WvString to int, when needed.
bool isnull () const
 returns true if this string is null
const WvFastStringifnull (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 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 }


Member Function Documentation

void WvFastString::do_format WvFastString output,
const char *  format,
const WvFastString *const *  a
[static, inherited]
 

when this is called, we assume output.str == NULL; it will be filled.

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.

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.

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.

int WvFastString::num  )  const [inline, inherited]
 

used to convert WvString to int, when needed.

we no longer provide a typecast, because it causes annoyance.


The documentation for this class was generated from the following file:
Generated on Fri May 20 11:17:52 2005 for WvStreams by  doxygen 1.4.2