MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Simple_cstring Class Reference

#include <sql_string.h>

Inheritance diagram for Simple_cstring:

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!

Definition at line 37 of file sql_string.h.

Member Function Documentation

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

Compare to another Simple_cstring.

Definition at line 94 of file sql_string.h.

bool Simple_cstring::is_set ( ) const
inline

Check if m_ptr is set.

Definition at line 86 of file sql_string.h.

Here is the caller graph for this function:

size_t Simple_cstring::length ( ) const
inline

Return name length.

Definition at line 90 of file sql_string.h.

Here is the caller graph for this function:

const char* Simple_cstring::ptr ( ) const
inline

Return string buffer.

Definition at line 82 of file sql_string.h.

Here is the caller graph for this function:

void Simple_cstring::set ( const char *  str_arg,
size_t  length_arg 
)
inlineprotected

Initialize from a C string whose length is already known.

Definition at line 46 of file sql_string.h.

Here is the caller graph for this function:

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

Set to a null-terminated string.

Definition at line 75 of file sql_string.h.

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

Copy to the given buffer

Definition at line 102 of file sql_string.h.


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