From 8080378736afeec840dc90581b1190377e8e980f Mon Sep 17 00:00:00 2001 From: seleznevae Date: Tue, 21 Jan 2020 19:03:57 +0300 Subject: [PATCH] [U] Updated docs --- docs/index.md | 3 +++ lib/fort.h | 2 ++ lib/fort.hpp | 4 ++-- src/fort.h | 2 ++ src/fort.hpp | 4 ++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 43fc3d9..b78f258 100644 --- a/docs/index.md +++ b/docs/index.md @@ -27,6 +27,9 @@ These pages contain the API documentation of **libfort** - simple library to cre - @link ft_table_write_ln ft_table_write_ln @endlink -- fill cells with the strings from the 2D array and move to the next line - @link ft_add_separator ft_add_separator @endlink -- add horizontal separator + - Remove content + - @link ft_erase_range ft_erase_range @endlink -- erase range of cells + - Modify appearance of the table - @link ft_set_default_border_style ft_set_default_border_style @endlink -- set default border style for all new created tables - @link ft_set_border_style ft_set_border_style @endlink -- modify border style of the table diff --git a/lib/fort.h b/lib/fort.h index 4d39e51..94b9154 100644 --- a/lib/fort.h +++ b/lib/fort.h @@ -738,6 +738,8 @@ int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style); #define FT_CUR_ROW (UINT_MAX - 1) /**< Current row */ /** @} */ +#define FT_MAX_ROW_INDEX (UINT_MAX - 2) +#define FT_MAX_COL_INDEX (UINT_MAX - 2) /** diff --git a/lib/fort.hpp b/lib/fort.hpp index cf2dc7c..5ebb51b 100644 --- a/lib/fort.hpp +++ b/lib/fort.hpp @@ -995,7 +995,7 @@ public: { if (FT_IS_ERROR(ft_erase_range(ps_table_->table_, property_owner_t::ps_row_idx_, 0, - property_owner_t::ps_row_idx_, (UINT_MAX - 2)))) { + property_owner_t::ps_row_idx_, FT_MAX_COL_INDEX))) { throw std::runtime_error("Failed to erase row"); } } @@ -1016,7 +1016,7 @@ public: { if (FT_IS_ERROR(ft_erase_range(ps_table_->table_, 0, ps_coll_idx_, - (UINT_MAX - 2), ps_coll_idx_))) { + FT_MAX_ROW_INDEX, ps_coll_idx_))) { throw std::runtime_error("Failed to erase column"); } } diff --git a/src/fort.h b/src/fort.h index 4d39e51..94b9154 100644 --- a/src/fort.h +++ b/src/fort.h @@ -738,6 +738,8 @@ int ft_set_border_style(ft_table_t *table, const struct ft_border_style *style); #define FT_CUR_ROW (UINT_MAX - 1) /**< Current row */ /** @} */ +#define FT_MAX_ROW_INDEX (UINT_MAX - 2) +#define FT_MAX_COL_INDEX (UINT_MAX - 2) /** diff --git a/src/fort.hpp b/src/fort.hpp index cf2dc7c..5ebb51b 100644 --- a/src/fort.hpp +++ b/src/fort.hpp @@ -995,7 +995,7 @@ public: { if (FT_IS_ERROR(ft_erase_range(ps_table_->table_, property_owner_t::ps_row_idx_, 0, - property_owner_t::ps_row_idx_, (UINT_MAX - 2)))) { + property_owner_t::ps_row_idx_, FT_MAX_COL_INDEX))) { throw std::runtime_error("Failed to erase row"); } } @@ -1016,7 +1016,7 @@ public: { if (FT_IS_ERROR(ft_erase_range(ps_table_->table_, 0, ps_coll_idx_, - (UINT_MAX - 2), ps_coll_idx_))) { + FT_MAX_ROW_INDEX, ps_coll_idx_))) { throw std::runtime_error("Failed to erase column"); } }