My Project
Public Member Functions | Protected Member Functions
Simple_cstring Class Reference

#include <sql_string.h>

Inheritance diagram for Simple_cstring:
Name_string Item_name_string

List of all members.

Public Member Functions

 Simple_cstring (const char *str_arg, size_t length_arg)
 Simple_cstring (const LEX_STRING arg)
void reset ()
void set (const char *str)
const char * ptr () const
bool is_set () const
size_t length () const
bool eq_bin (const Simple_cstring other) const
void strcpy (char *buff) const

Protected Member Functions

void set (const char *str_arg, size_t length_arg)

Detailed Description

A wrapper class for null-terminated constant strings. Constructors make sure that the position of the '\0' terminating byte in m_str is always in sync with m_length.

This class must stay as small as possible as we often pass it and its descendants (such as Name_string) into functions using call-by-value evaluation.

Don't add new members or virual methods into this class!


Member Function Documentation

bool Simple_cstring::eq_bin ( const Simple_cstring  other) const [inline]

Compare to another Simple_cstring.

bool Simple_cstring::is_set ( ) const [inline]

Check if m_ptr is set.

size_t Simple_cstring::length ( ) const [inline]

Return name length.

const char* Simple_cstring::ptr ( ) const [inline]

Return string buffer.

void Simple_cstring::set ( const char *  str_arg,
size_t  length_arg 
) [inline, protected]

Initialize from a C string whose length is already known.

void Simple_cstring::set ( const char *  str) [inline]

Set to a null-terminated string.

void Simple_cstring::strcpy ( char *  buff) const [inline]

Copy to the given buffer


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines