mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
update documentation
This commit is contained in:
@@ -27,6 +27,8 @@ class parser {
|
||||
|
||||
constexpr static bool ignore_header = setup<Matchers...>::ignore_header;
|
||||
|
||||
constexpr static bool ignore_empty = setup<Matchers...>::ignore_empty;
|
||||
|
||||
public:
|
||||
parser(const std::string& file_name,
|
||||
const std::string& delim = ss::default_delimiter)
|
||||
@@ -558,16 +560,27 @@ private:
|
||||
reader& operator=(const reader& other) = delete;
|
||||
|
||||
bool read_next() {
|
||||
++line_number_;
|
||||
memset(next_line_buffer_, '\0', next_line_size_);
|
||||
ssize_t ssize =
|
||||
get_line(&next_line_buffer_, &next_line_size_, file_);
|
||||
|
||||
if (ssize == -1) {
|
||||
return false;
|
||||
ssize_t ssize;
|
||||
size_t size = 0;
|
||||
while (size == 0) {
|
||||
++line_number_;
|
||||
if (next_line_size_ > 0) {
|
||||
next_line_buffer_[0] = '\0';
|
||||
}
|
||||
ssize = get_line(&next_line_buffer_, &next_line_size_, file_);
|
||||
|
||||
if (ssize == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
size = remove_eol(next_line_buffer_, ssize);
|
||||
|
||||
if constexpr (!ignore_empty) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
size_t size = remove_eol(next_line_buffer_, ssize);
|
||||
size_t limit = 0;
|
||||
|
||||
if constexpr (escaped_multiline_enabled) {
|
||||
|
||||
@@ -173,6 +173,12 @@ class string_error;
|
||||
|
||||
class ignore_header;
|
||||
|
||||
////////////////
|
||||
// ignore_empty
|
||||
////////////////
|
||||
|
||||
class ignore_empty;
|
||||
|
||||
////////////////
|
||||
// setup implementation
|
||||
////////////////
|
||||
@@ -194,16 +200,24 @@ private:
|
||||
template <typename T>
|
||||
struct is_ignore_header : std::is_same<T, ignore_header> {};
|
||||
|
||||
template <typename T>
|
||||
struct is_ignore_empty : std::is_same<T, ignore_empty> {};
|
||||
|
||||
constexpr static auto count_matcher = count_v<is_matcher, Ts...>;
|
||||
|
||||
constexpr static auto count_multiline =
|
||||
count_v<is_instance_of_multiline, Ts...>;
|
||||
|
||||
constexpr static auto count_string_error = count_v<is_string_error, Ts...>;
|
||||
|
||||
constexpr static auto count_ignore_header =
|
||||
count_v<is_ignore_header, Ts...>;
|
||||
|
||||
constexpr static auto count_ignore_empty = count_v<is_ignore_empty, Ts...>;
|
||||
|
||||
constexpr static auto number_of_valid_setup_types =
|
||||
count_matcher + count_multiline + count_string_error +
|
||||
count_ignore_header;
|
||||
count_ignore_header + count_ignore_empty;
|
||||
|
||||
using trim_left_only = get_matcher_t<trim_left, Ts...>;
|
||||
using trim_right_only = get_matcher_t<trim_right, Ts...>;
|
||||
@@ -219,6 +233,7 @@ public:
|
||||
using multiline = get_multiline_t<Ts...>;
|
||||
constexpr static bool string_error = (count_string_error == 1);
|
||||
constexpr static bool ignore_header = (count_ignore_header == 1);
|
||||
constexpr static bool ignore_empty = (count_ignore_empty == 1);
|
||||
|
||||
private:
|
||||
#define ASSERT_MSG "cannot have the same match character in multiple matchers"
|
||||
|
||||
Reference in New Issue
Block a user