Skip to content

Commit

Permalink
add a fmt test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Aug 6, 2024
1 parent 0b84b5d commit 25f4b65
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module foo

pub const endline_cr_len = 1

pub struct RandomAccessReader {
pub mut:
index i64

start_index i64
end_index i64 = -1

end_line u8 = `\n`
end_line_len int = foo.endline_cr_len // size of the endline rune \n = 1, \r\n = 2
separator u8 = `,` // comma is the default separator
separator_len int = 1 // size of the separator rune
quote u8 = `"` // double quote is the standard quote char
quote_remove bool // if true clear the cell from the quotes
comment u8 = `#` // every line that start with the quote char is ignored

default_cell string = '*' // return this string if out of the csv boundaries
empty_cell string = '#' // retunrn this if empty cell
// ram buffer
mem_buf_type u32 // buffer type 0=File,1=RAM
mem_buf voidptr // buffer used to load chars from file
mem_buf_size i64 // size of the buffer
mem_buf_start i64 = -1 // start index in the file of the read buffer
mem_buf_end i64 = -1 // end index in the file of the read buffer
// csv map for quick access
csv_map [][]i64
// header
header_row int = -1 // row index of the header in the csv_map
header_list []HeaderItem // list of the header item
header_map map[string]int // map from header label to column index
}

0 comments on commit 25f4b65

Please sign in to comment.