Logo Search packages:      
Sourcecode: pan version File versions  Download package

pan::StringView Struct Reference
[General Utilities]

#include <string-view.h>

List of all members.

Detailed Description

A shallow copy a C string, plus utilities to let us substring, tokenize, walk, search, or otherwise manipulate it without having to modify the original or allocate new strings.

Definition at line 36 of file string-view.h.

Public Types

typedef const char * const_iterator

Public Member Functions

void assign (const char *s, size_t l)
void assign (const char *s)
void assign (const std::string &s)
const char & back () const
const_iterator begin () const
void clear ()
void eat_chars (size_t)
bool empty () const
const_iterator end () const
const char & front () const
void ltrim ()
 operator const std::string () const
bool operator!= (const char *s) const
bool operator!= (const StringView &p) const
bool operator< (const StringView &p) const
StringViewoperator= (const char *s)
StringViewoperator= (const std::string &s)
bool operator== (const char *s) const
bool operator== (const StringView &p) const
bool pop_last_token (StringView &setme, char delimiter=' ')
bool pop_token (StringView &setme, char delimiter=' ')
void rtrim ()
void rtruncate (size_t)
char * strchr (char needle, size_t p=0) const
int strcmp (const char *s, size_t l) const
int strcmp (const StringView &p) const
 StringView (const StringView &p)
 StringView (const char *s, const char *e)
 StringView (const char *s, size_t l)
 StringView (const char *s)
 StringView (const std::string &s)
int strncasecmp (const char *p, unsigned int l)
char * strpbrk (const char *needles) const
char * strrchr (char needle) const
char * strstr (const char *s) const
char * strstr (const StringView &p) const
void substr (const char *start, const char *end, StringView &setme) const
StringView substr (const char *start, const char *end) const
std::string to_string () const
void trim ()
void truncate (size_t)

Static Public Member Functions

static char * strchr (const char *haystack, size_t haystack_len, char needle)
static int strcmp (const char *str_a, size_t str_a_len, const char *str_b, size_t str_b_len)
static int strncpy (char *target, size_t target_size, const char *source_str, size_t source_len)
static char * strpbrk (const char *haystack, size_t haystack_len, const char *needles)
static char * strrchr (const char *haystack, size_t haystack_len, char needle)
static char * strstr (const char *haystack, size_t haystack_len, const char *needle, size_t needle_len)

Public Attributes

size_t len
const char * str

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

Generated by  Doxygen 1.6.0   Back to index