1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Optimized GIS functions

This commit is contained in:
monty@mashka.mysql.fi
2004-03-04 08:50:37 +02:00
parent 3baf20ab04
commit afd8f38f4e
17 changed files with 1672 additions and 1607 deletions

View File

@@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
class GTextReadStream
class Gis_read_stream
{
public:
enum TokTypes
enum enum_tok_types
{
unknown,
eostream,
@@ -29,41 +29,47 @@ public:
comma
};
GTextReadStream(const char *buffer, int size)
:m_cur(buffer), m_limit(buffer + size), m_last_text_position(buffer),
m_err_msg(NULL)
Gis_read_stream(const char *buffer, int size)
:m_cur(buffer), m_limit(buffer + size), m_err_msg(NULL)
{}
GTextReadStream(): m_cur(NULL), m_limit(NULL), m_err_msg(NULL)
Gis_read_stream(): m_cur(NullS), m_limit(NullS), m_err_msg(NullS)
{}
~GTextReadStream()
~Gis_read_stream()
{
my_free(m_err_msg, MYF(MY_ALLOW_ZERO_PTR));
}
int get_next_toc_type() const;
const char *get_next_word(int *word_len);
int get_next_number(double *d);
char get_next_symbol();
enum enum_tok_types get_next_toc_type();
bool get_next_word(LEX_STRING *);
bool get_next_number(double *);
bool check_next_symbol(char);
const char *get_last_text_position() const
inline void skip_space()
{
return m_last_text_position;
while (my_isspace(&my_charset_latin1, *m_cur))
m_cur++;
}
/* Skip next character, if match. Return 1 if no match */
inline bool skip_char(char skip)
{
skip_space();
if (*m_cur != skip)
return 1; /* Didn't find char */
m_cur++;
return 0;
}
void set_error_msg(const char *msg);
// caller should free this pointer
char *get_error_msg()
{
char *err_msg = m_err_msg;
m_err_msg = NULL;
m_err_msg= NullS;
return err_msg;
}
protected:
const char *m_cur;
const char *m_limit;
const char *m_last_text_position;
char *m_err_msg;
};