mirror of
https://github.com/MariaDB/server.git
synced 2025-08-16 18:19:41 +00:00
Cleanup: moving the definition of Lex_cstring from vers_string.h to lex_string.h
This commit is contained in:
@ -18,8 +18,46 @@
|
||||
#ifndef LEX_STRING_INCLUDED
|
||||
#define LEX_STRING_INCLUDED
|
||||
|
||||
|
||||
typedef struct st_mysql_const_lex_string LEX_CSTRING;
|
||||
|
||||
|
||||
class Lex_cstring : public LEX_CSTRING
|
||||
{
|
||||
public:
|
||||
Lex_cstring()
|
||||
{
|
||||
str= NULL;
|
||||
length= 0;
|
||||
}
|
||||
Lex_cstring(const char *_str, size_t _len)
|
||||
{
|
||||
str= _str;
|
||||
length= _len;
|
||||
}
|
||||
Lex_cstring(const char *start, const char *end)
|
||||
{
|
||||
DBUG_ASSERT(start <= end);
|
||||
str= start;
|
||||
length= end - start;
|
||||
}
|
||||
void set(const char *_str, size_t _len)
|
||||
{
|
||||
str= _str;
|
||||
length= _len;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Lex_cstring_strlen: public Lex_cstring
|
||||
{
|
||||
public:
|
||||
Lex_cstring_strlen(const char *from)
|
||||
:Lex_cstring(from, from ? strlen(from) : 0)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
/* Functions to compare if two lex strings are equal */
|
||||
|
||||
static inline bool lex_string_cmp(CHARSET_INFO *charset, const LEX_CSTRING *a,
|
||||
|
@ -17,6 +17,8 @@
|
||||
#ifndef VERS_STRING_INCLUDED
|
||||
#define VERS_STRING_INCLUDED
|
||||
|
||||
#include "lex_string.h"
|
||||
|
||||
/*
|
||||
LEX_CSTRING with comparison semantics.
|
||||
*/
|
||||
@ -45,41 +47,6 @@ struct Compare_identifiers
|
||||
}
|
||||
};
|
||||
|
||||
class Lex_cstring : public LEX_CSTRING
|
||||
{
|
||||
public:
|
||||
Lex_cstring()
|
||||
{
|
||||
str= NULL;
|
||||
length= 0;
|
||||
}
|
||||
Lex_cstring(const char *_str, size_t _len)
|
||||
{
|
||||
str= _str;
|
||||
length= _len;
|
||||
}
|
||||
Lex_cstring(const char *start, const char *end)
|
||||
{
|
||||
DBUG_ASSERT(start <= end);
|
||||
str= start;
|
||||
length= end - start;
|
||||
}
|
||||
void set(const char *_str, size_t _len)
|
||||
{
|
||||
str= _str;
|
||||
length= _len;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Lex_cstring_strlen: public Lex_cstring
|
||||
{
|
||||
public:
|
||||
Lex_cstring_strlen(const char *from)
|
||||
:Lex_cstring(from, from ? strlen(from) : 0)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
template <class Compare>
|
||||
struct Lex_cstring_with_compare : public Lex_cstring
|
||||
|
Reference in New Issue
Block a user