MySQL 8.4.3
Source Code Documentation
gstream.h
Go to the documentation of this file.
1#ifndef GSTREAM_INCLUDED
2#define GSTREAM_INCLUDED
3
4/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License, version 2.0,
8 as published by the Free Software Foundation.
9
10 This program is designed to work with certain software (including
11 but not limited to OpenSSL) that is licensed under separate terms,
12 as designated in a particular file or component or in included license
13 documentation. The authors of MySQL hereby grant you an additional
14 permission to link the program and your derivative works with the
15 separately licensed software that they have either included with
16 the program or referenced in the documentation.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
26
27#include <stddef.h>
28
29#include "lex_string.h"
31#include "mysql/strings/m_ctype.h" /* my_charset_latin1, my_charset_bin */
32#include "nulls.h"
33
34class THD;
35
37 public:
39
41 int size)
42 : m_cur(buffer),
46 m_thd(thd) {}
49
52 bool get_next_number(double *);
53 bool check_next_symbol(char);
54
56
57 inline void skip_space() {
59 }
60 /* Skip next character, if match. Return 1 if no match */
61 inline bool skip_char(char skip) {
62 skip_space();
63 if ((m_cur >= m_limit) || *m_cur != skip)
64 return true; /* Didn't find char */
65 m_cur++;
66 return false;
67 }
68 void set_error_msg(const char *msg);
69
70 // caller should free this pointer
71 char *get_error_msg() {
72 char *err_msg = m_err_msg;
74 return err_msg;
75 }
76
77 THD *thd() { return m_thd; }
78
79 protected:
80 const char *m_cur;
81 const char *m_limit;
82 char *m_err_msg;
84
85 private:
87};
88
89#endif /* GSTREAM_INCLUDED */
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Definition: gstream.h:36
enum_tok_types
Definition: gstream.h:38
@ eostream
Definition: gstream.h:38
@ word
Definition: gstream.h:38
@ l_bra
Definition: gstream.h:38
@ unknown
Definition: gstream.h:38
@ comma
Definition: gstream.h:38
@ numeric
Definition: gstream.h:38
@ r_bra
Definition: gstream.h:38
void skip_space()
Definition: gstream.h:57
const char * m_cur
Definition: gstream.h:80
Gis_read_stream(THD *thd, const CHARSET_INFO *charset, const char *buffer, int size)
Definition: gstream.h:40
const char * m_limit
Definition: gstream.h:81
char * m_err_msg
Definition: gstream.h:82
bool get_next_number(double *)
Definition: gstream.cc:76
bool is_end_of_stream()
Definition: gstream.h:55
bool get_next_word(LEX_CSTRING *)
Definition: gstream.cc:57
THD * thd()
Definition: gstream.h:77
bool check_next_symbol(char)
Definition: gstream.cc:93
enum enum_tok_types get_next_toc_type()
Definition: gstream.cc:46
void set_error_msg(const char *msg)
Definition: gstream.cc:110
const CHARSET_INFO * m_charset
Definition: gstream.h:83
THD * m_thd
Definition: gstream.h:86
~Gis_read_stream()
Definition: gstream.h:48
Gis_read_stream()
Definition: gstream.h:47
bool skip_char(char skip)
Definition: gstream.h:61
char * get_error_msg()
Definition: gstream.h:71
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
A better implementation of the UNIX ctype(3) library.
bool my_isspace(const CHARSET_INFO *cs, char ch)
Definition: m_ctype.h:593
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_latin1
Definition: ctype-latin1.cc:366
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
const std::string charset("charset")
static size_t skip(size_t pos_start, size_t match_len)
Definition: uri.cc:82
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: nulls.h:33
Definition: m_ctype.h:423
Definition: mysql_lex_string.h:40