lftp  4.4.6
About: lftp is a command line ftp client (FTP, HTTP, ssl support, background transfer, reget, reput, ...)
  Fossies Dox: lftp-4.4.6.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
xstring Class Reference

#include <xstring.h>

Inheritance diagram for xstring:
Collaboration diagram for xstring:

Public Member Functions

 xstring ()
 
 xstring (const char *s)
 
 xstring (const char *s, int l)
 
 xstring (const xstring_clonable &c)
 
const xstring_clonablecopy () const
 
void get_space (size_t s)
 
void get_space2 (size_t s, size_t g)
 
char * add_space (size_t s)
 
void add_commit (int new_len)
 
size_t length () const
 
xstringset (const xstring &s)
 
xstringset (const char *s)
 
xstringnset (const char *s, int len)
 
xstringset_allocated (char *s)
 
xstringmove_here (xstring &)
 
xstringset_substr (int start, size_t sublen, const char *, size_t)
 
xstringset_substr (int start, size_t sublen, const char *)
 
xstringset_substr (int start, size_t sublen, const xstring &s)
 
xstringappend (const char *s)
 
xstringappend (char c)
 
xstringappend (const char *s, size_t len)
 
xstringappend (const xstring &s)
 
xstringappend_padding (int len, char ch)
 
xstringvappend (va_list)
 
xstringvappend (...) ATTRIBUTE_SENTINEL
 
xstringvset (...) ATTRIBUTE_SENTINEL
 
xstringvsetf (const char *fmt, va_list ap)
 
xstringsetf (const char *fmt,...) PRINTF_LIKE(2
 
xstring xstringvappendf (const char *fmt, va_list ap)
 
xstringappendf (const char *fmt,...) PRINTF_LIKE(2
 
void truncate (size_t n=0)
 
void truncate_at (char c)
 
void set_length (size_t n)
 
char * borrow ()
 
bool begins_with (const char *o_buf, size_t o_len) const
 
bool begins_with (const char *s) const
 
bool ends_with (const char *o_buf, size_t o_len) const
 
bool ends_with (const char *s) const
 
bool eq (const char *o_buf, size_t o_len) const
 
bool eq (const char *s) const
 
bool eq (const xstring &o) const
 
bool ne (const xstring &o) const
 
bool chomp (char c='\n')
 
void rtrim (char c=' ')
 
char last_char () const
 
unsigned skip_all (unsigned i, char c) const
 
int instr (char c) const
 
void _clear ()
 
void _set (const char *s)
 
void unset ()
 
bool is_binary () const
 
const char * dump_to (xstring &out) const
 
const char * dump () const
 
const char * hexdump_to (xstring &out) const
 
const char * hexdump () const
 
xstringurl_decode (int flags=0)
 
xstringappend_url_encoded (const char *s, int len, const char *unsafe)
 
xstringappend_url_encoded (const char *s, const char *unsafe)
 
xstringappend_url_encoded (const xstring &s, const char *unsafe)
 
xstringappend_quoted (const char *s, int len)
 
xstringappend_quoted (const char *s)
 
xstringhex_decode ()
 
- Public Member Functions inherited from xstring0
 ~xstring0 ()
 
 operator const char * () const
 
const char * get () const
 
char * get_non_const ()
 
void _clear ()
 

Static Public Member Functions

xstring static xstringget_tmp ()
 
static xstringget_tmp (const char *s)
 
static xstringget_tmp (const char *s, int n)
 
static char * tmp_buf (int n)
 
static xstringvformat (const char *fmt, va_list ap)
 
static xstringformat (const char *fmt,...) PRINTF_LIKE(1
 
static xstring static xstringcat (const char *first,...) ATTRIBUTE_SENTINEL
 
static xstringjoin (const char *sep, int n,...)
 

Static Public Attributes

static xstring null
 

Additional Inherited Members

- Protected Member Functions inherited from xstring0
 xstring0 ()
 
 xstring0 (const xstring0 &)
 
int _url_decode (size_t len, int flags)
 
int _hex_decode (size_t len)
 
- Protected Attributes inherited from xstring0
char * buf
 

Detailed Description

Definition at line 135 of file xstring.h.

Constructor & Destructor Documentation

xstring::xstring ( )
inline

Definition at line 151 of file xstring.h.

xstring::xstring ( const char *  s)
inline

Definition at line 152 of file xstring.h.

xstring::xstring ( const char *  s,
int  l 
)
inline

Definition at line 153 of file xstring.h.

xstring::xstring ( const xstring_clonable c)

Definition at line 116 of file xstring.cc.

References xstring0::buf, get_space(), and memcpy.

Member Function Documentation

void xstring::_clear ( )
inline

Definition at line 216 of file xstring.h.

Referenced by unset().

void xstring::_set ( const char *  s)
inline

Definition at line 217 of file xstring.h.

void xstring::add_commit ( int  new_len)
inline

Definition at line 162 of file xstring.h.

Referenced by append_padding().

char * xstring::add_space ( size_t  s)

Definition at line 72 of file xstring.cc.

References xstring0::get_non_const(), and get_space().

Referenced by append_padding(), and append_url_encoded().

xstring & xstring::append ( char  c)

Definition at line 164 of file xstring.cc.

References xstring0::buf, c, and get_space().

xstring & xstring::append ( const char *  s,
size_t  len 
)

Definition at line 151 of file xstring.cc.

References xstring0::buf, get_space(), and memcpy.

xstring& xstring::append ( const xstring s)
inline

Definition at line 178 of file xstring.h.

References append(), xstring0::get(), and length().

Referenced by append().

xstring & xstring::append_padding ( int  len,
char  ch 
)

Definition at line 170 of file xstring.cc.

References add_commit(), and add_space().

Referenced by Job::FormatJobTitle().

xstring & xstring::append_quoted ( const char *  s,
int  len 
)
xstring& xstring::append_quoted ( const char *  s)
inline

Definition at line 232 of file xstring.h.

References append_quoted().

Referenced by append_quoted().

xstring & xstring::append_url_encoded ( const char *  s,
int  len,
const char *  unsafe 
)

Definition at line 564 of file xstring.cc.

References add_space(), append(), appendf(), c, and need_quote.

Referenced by Http::Do(), url::encode(), and History::Set().

xstring& xstring::append_url_encoded ( const char *  s,
const char *  unsafe 
)
inline

Definition at line 228 of file xstring.h.

References append_url_encoded().

Referenced by append_url_encoded().

xstring& xstring::append_url_encoded ( const xstring s,
const char *  unsafe 
)
inline

Definition at line 229 of file xstring.h.

References append_url_encoded(), and length().

Referenced by append_url_encoded().

bool xstring::begins_with ( const char *  o_buf,
size_t  o_len 
) const

Definition at line 177 of file xstring.cc.

References xstring0::buf, and memcmp.

Referenced by eq().

bool xstring::begins_with ( const char *  s) const
inline

Definition at line 203 of file xstring.h.

References begins_with().

Referenced by begins_with().

bool xstring::chomp ( char  c = '\n')

Definition at line 300 of file xstring.cc.

Referenced by FileAccess::Path::Change(), ProtoLog::Log2(), Ftp::ParseLongList(), and rtrim().

const xstring_clonable& xstring::copy ( ) const
inline

Definition at line 157 of file xstring.h.

const char * xstring::dump ( ) const

Definition at line 444 of file xstring.cc.

References dump_to(), and get_tmp().

Referenced by Buffer::Dump().

const char * xstring::dump_to ( xstring out) const

Definition at line 448 of file xstring.cc.

References append(), appendf(), xstring0::buf, hexdump_to(), is_binary(), length(), mbsnwidth(), s, and truncate().

Referenced by dump().

bool xstring::ends_with ( const char *  o_buf,
size_t  o_len 
) const

Definition at line 189 of file xstring.cc.

References xstring0::buf, and memcmp.

bool xstring::ends_with ( const char *  s) const
inline

Definition at line 205 of file xstring.h.

References ends_with().

Referenced by ends_with().

bool xstring::eq ( const char *  o_buf,
size_t  o_len 
) const
bool xstring::eq ( const char *  s) const
inline

Definition at line 207 of file xstring.h.

References eq().

Referenced by eq().

bool xstring::eq ( const xstring o) const
inline

Definition at line 208 of file xstring.h.

References eq(), xstring0::get(), and length().

Referenced by eq().

void xstring::get_space ( size_t  s)
void xstring::get_space2 ( size_t  s,
size_t  g 
)

Definition at line 62 of file xstring.cc.

References xstring0::buf, s, xmalloc(), and xrealloc().

Referenced by Buffer::Allocate(), and get_space().

static xstring& xstring::get_tmp ( const char *  s)
inlinestatic

Definition at line 188 of file xstring.h.

References get_tmp(), and set().

Referenced by get_tmp().

static xstring& xstring::get_tmp ( const char *  s,
int  n 
)
inlinestatic

Definition at line 189 of file xstring.h.

References get_tmp(), and nset().

Referenced by get_tmp().

xstring & xstring::hex_decode ( )

Definition at line 556 of file xstring.cc.

References xstring0::_hex_decode(), length(), and set_length().

Referenced by Torrent::Do().

const char * xstring::hexdump ( ) const

Definition at line 440 of file xstring.cc.

References get_tmp(), and hexdump_to().

Referenced by DHT::DHT(), DHT::Do(), and DHT::HandlePacket().

const char * xstring::hexdump_to ( xstring out) const

Definition at line 432 of file xstring.cc.

References appendf(), xstring0::buf, length(), and s.

Referenced by dump_to(), and hexdump().

int xstring::instr ( char  c) const

Definition at line 317 of file xstring.cc.

References xstring0::buf.

Referenced by TorrentTracker::AddPeer(), and Torrent::Do().

bool xstring::is_binary ( ) const

Definition at line 425 of file xstring.cc.

Referenced by dump_to().

xstring & xstring::join ( const char *  sep,
int  n,
  ... 
)
static

Definition at line 394 of file xstring.cc.

References a, append(), get_tmp(), length(), and truncate().

char xstring::last_char ( ) const
inline

Definition at line 212 of file xstring.h.

References xstring0::buf.

Referenced by FileAccess::Path::Change(), mvJob::mvJob(), and ParsedURL::parse().

xstring & xstring::move_here ( xstring o)

Definition at line 138 of file xstring.cc.

References xstring0::buf, unset(), and xfree().

Referenced by Torrent::Do(), and get_tmp().

bool xstring::ne ( const xstring o) const
inline

Definition at line 209 of file xstring.h.

References eq().

Referenced by FileAccess::MkdirMakeSet().

void xstring::rtrim ( char  c = ' ')

Definition at line 307 of file xstring.cc.

References chomp().

Referenced by CMD(), GetFileInfo::Do(), and FileVerificator::Do().

xstring & xstring::set ( const char *  s)

Definition at line 111 of file xstring.cc.

References nset(), and xstrlen().

xstring & xstring::set_allocated ( char *  s)
void xstring::set_length ( size_t  n)
inline
xstring & xstring::set_substr ( int  start,
size_t  sublen,
const char *  s,
size_t  s_len 
)

Definition at line 283 of file xstring.cc.

References get_space(), and memcpy.

Referenced by CMD(), GenericParseListInfo::Do(), and set_substr().

xstring & xstring::set_substr ( int  start,
size_t  sublen,
const char *  s 
)

Definition at line 295 of file xstring.cc.

References set_substr(), and xstrlen().

xstring& xstring::set_substr ( int  start,
size_t  sublen,
const xstring s 
)
inline

Definition at line 173 of file xstring.h.

References xstring0::get(), length(), and set_substr().

Referenced by set_substr().

xstring & xstring::setf ( const char *  fmt,
  ... 
)

Definition at line 343 of file xstring.cc.

References vsetf().

Referenced by Http::Do(), and History::Set().

unsigned xstring::skip_all ( unsigned  i,
char  c 
) const

Definition at line 311 of file xstring.cc.

char * xstring::tmp_buf ( int  n)
static

Definition at line 371 of file xstring.cc.

References xstring0::get_non_const(), get_space(), and get_tmp().

Referenced by sockaddr_u::address(), and ResMgr::ERegExpValidate().

void xstring::truncate_at ( char  c)

Definition at line 271 of file xstring.cc.

References xstring0::buf, and p.

Referenced by Http::Do().

void xstring::unset ( )
inline

Definition at line 218 of file xstring.h.

References _clear(), xstring0::buf, and xfree().

Referenced by move_here(), and set_allocated().

xstring & xstring::url_decode ( int  flags = 0)

Definition at line 545 of file xstring.cc.

References xstring0::_url_decode(), length(), and set_length().

Referenced by url::decode(), and ParsedURL::parse().

xstring & xstring::vappend ( va_list  va)

Definition at line 238 of file xstring.cc.

References get_space().

Referenced by cat(), FileInfo::MakeLongName(), vappend(), and vset().

xstring & xstring::vappend (   ...)

Definition at line 247 of file xstring.cc.

References vappend().

xstring & xstring::vappendf ( const char *  fmt,
va_list  ap 
)

Definition at line 325 of file xstring.cc.

References get_space(), set_length(), and vsnprintf().

Referenced by appendf(), ProtoLog::LogError(), ProtoLog::LogNote(), and vsetf().

static xstring& xstring::vformat ( const char *  fmt,
va_list  ap 
)
inlinestatic
xstring& xstring::vsetf ( const char *  fmt,
va_list  ap 
)
inline

Definition at line 183 of file xstring.h.

References truncate(), and vappendf().

Referenced by setf(), and vformat().

Member Data Documentation

xstring xstring::null
static

Definition at line 236 of file xstring.h.

Referenced by url::decode(), url::encode(), BeNode::lookup_str(), and shell_encode().


The documentation for this class was generated from the following files: