MySQL 8.0.40
Source Code Documentation
READ_INFO Class Reference

Public Member Functions

 READ_INFO (File file, size_t tot_length, const CHARSET_INFO *cs, const String &field_term, const String &line_start, const String &line_term, const String &enclosed, int escape, bool get_it_from_net, bool is_fifo)
 
 ~READ_INFO ()
 
bool read_field ()
 
bool read_fixed_length ()
 Read a row with fixed length. More...
 
bool next_line ()
 
char unescape (char chr)
 
bool terminator (const uchar *ptr, size_t length)
 Skip the terminator string (if any) in the input stream. More...
 
bool find_start_of_fields ()
 
int read_value (int delim, String *val)
 
int read_cdata (String *val, bool *have_cdata)
 
bool read_xml ()
 
void clear_level (int level)
 
void end_io_cache ()
 
void set_io_cache_arg (void *arg)
 
void skip_data_till_eof ()
 skip all data till the eof. More...
 

Public Attributes

bool error
 
bool line_truncated
 
bool found_null
 
bool enclosed
 
ucharrow_start
 
ucharrow_end
 
const CHARSET_INFOread_charset
 
List< XML_TAGtaglist
 

Private Member Functions

size_t max_size ()
 
size_t check_length (size_t length, size_t grow)
 

Private Attributes

File file
 
ucharbuffer
 
ucharend_of_buff
 
size_t buff_length
 
const ucharfield_term_ptr
 
const ucharline_term_ptr
 
const char * line_start_ptr
 
const char * line_start_end
 
size_t field_term_length
 
size_t line_term_length
 
size_t enclosed_length
 
int field_term_char
 
int line_term_char
 
int enclosed_char
 
int escape_char
 
int * stack
 
int * stack_pos
 
bool found_end_of_line
 
bool start_of_line
 
bool eof
 
bool need_end_io_cache
 
IO_CACHE cache
 
int level
 

Constructor & Destructor Documentation

◆ READ_INFO()

READ_INFO::READ_INFO ( File  file,
size_t  tot_length,
const CHARSET_INFO cs,
const String field_term,
const String line_start,
const String line_term,
const String enclosed,
int  escape,
bool  get_it_from_net,
bool  is_fifo 
)

◆ ~READ_INFO()

READ_INFO::~READ_INFO ( )

Member Function Documentation

◆ check_length()

size_t READ_INFO::check_length ( size_t  length,
size_t  grow 
)
inlineprivate

◆ clear_level()

void READ_INFO::clear_level ( int  level)

◆ end_io_cache()

void READ_INFO::end_io_cache ( )
inline

◆ find_start_of_fields()

bool READ_INFO::find_start_of_fields ( )
Returns
true if error (unexpected end of file/line)

◆ max_size()

size_t READ_INFO::max_size ( )
inlineprivate

◆ next_line()

bool READ_INFO::next_line ( )
Returns
true if error (unexpected end of file/line)

◆ read_cdata()

int READ_INFO::read_cdata ( String val,
bool *  have_cdata 
)

◆ read_field()

bool READ_INFO::read_field ( )
Returns
true if error. If READ_INFO::error is true, then error is fatal (OOM or charset error). Otherwise see READ_INFO::found_end_of_line for unexpected EOL error or READ_INFO::eof for EOF error respectively.

◆ read_fixed_length()

bool READ_INFO::read_fixed_length ( )

Read a row with fixed length.

Note
The row may not be fixed size on disk if there are escape characters in the file.
One can't use fixed length with multi-byte charset **
Returns
true if error (unexpected end of file/line)

◆ read_value()

int READ_INFO::read_value ( int  delim,
String val 
)

◆ read_xml()

bool READ_INFO::read_xml ( )

◆ set_io_cache_arg()

void READ_INFO::set_io_cache_arg ( void *  arg)
inline

◆ skip_data_till_eof()

void READ_INFO::skip_data_till_eof ( )
inline

skip all data till the eof.

◆ terminator()

bool READ_INFO::terminator ( const uchar ptr,
size_t  length 
)
inline

Skip the terminator string (if any) in the input stream.

Parameters
ptrTerminator string.
lengthTerminator string length.
Returns
false if terminator was found and skipped, true if terminator was not found

◆ unescape()

char READ_INFO::unescape ( char  chr)

Member Data Documentation

◆ buff_length

size_t READ_INFO::buff_length
private

◆ buffer

uchar* READ_INFO::buffer
private

◆ cache

IO_CACHE READ_INFO::cache
private

◆ enclosed

bool READ_INFO::enclosed

◆ enclosed_char

int READ_INFO::enclosed_char
private

◆ enclosed_length

size_t READ_INFO::enclosed_length
private

◆ end_of_buff

uchar* READ_INFO::end_of_buff
private

◆ eof

bool READ_INFO::eof
private

◆ error

bool READ_INFO::error

◆ escape_char

int READ_INFO::escape_char
private

◆ field_term_char

int READ_INFO::field_term_char
private

◆ field_term_length

size_t READ_INFO::field_term_length
private

◆ field_term_ptr

const uchar* READ_INFO::field_term_ptr
private

◆ file

File READ_INFO::file
private

◆ found_end_of_line

bool READ_INFO::found_end_of_line
private

◆ found_null

bool READ_INFO::found_null

◆ level

int READ_INFO::level
private

◆ line_start_end

const char * READ_INFO::line_start_end
private

◆ line_start_ptr

const char* READ_INFO::line_start_ptr
private

◆ line_term_char

int READ_INFO::line_term_char
private

◆ line_term_length

size_t READ_INFO::line_term_length
private

◆ line_term_ptr

const uchar * READ_INFO::line_term_ptr
private

◆ line_truncated

bool READ_INFO::line_truncated

◆ need_end_io_cache

bool READ_INFO::need_end_io_cache
private

◆ read_charset

const CHARSET_INFO* READ_INFO::read_charset

◆ row_end

uchar * READ_INFO::row_end

◆ row_start

uchar* READ_INFO::row_start

◆ stack

int* READ_INFO::stack
private

◆ stack_pos

int * READ_INFO::stack_pos
private

◆ start_of_line

bool READ_INFO::start_of_line
private

◆ taglist

List<XML_TAG> READ_INFO::taglist

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