tmp
This commit is contained in:
parent
8ae228a0d3
commit
541ef075f2
@ -26,7 +26,7 @@ add_example(kde_ex OFF)
|
|||||||
add_example(meshio_ex OFF)
|
add_example(meshio_ex OFF)
|
||||||
add_example(autodiff_ex OFF)
|
add_example(autodiff_ex OFF)
|
||||||
add_example(multinary_ex OFF)
|
add_example(multinary_ex OFF)
|
||||||
add_example(text_io_ex OFF)
|
add_example(dsv_io_ex OFF)
|
||||||
add_example(getoption_ex OFF)
|
add_example(getoption_ex OFF)
|
||||||
add_example(process_ex OFF)
|
add_example(process_ex OFF)
|
||||||
add_example(array_ex OFF)
|
add_example(array_ex OFF)
|
||||||
|
@ -42,6 +42,8 @@ int main(int argc, char const *argv[]) try
|
|||||||
//tc.filter("America", "BLZ", RowHead);
|
//tc.filter("America", "BLZ", RowHead);
|
||||||
//tc.save_text("out");
|
//tc.save_text("out");
|
||||||
|
|
||||||
|
if (tc.has_column("Continent_s")) std::cout << "Find Column\n";
|
||||||
|
|
||||||
dsv_io tc2 = tc.export_table();
|
dsv_io tc2 = tc.export_table();
|
||||||
//tc2.head_records(tc.head_records());
|
//tc2.head_records(tc.head_records());
|
||||||
tc2.delimeter('|');
|
tc2.delimeter('|');
|
@ -643,6 +643,12 @@ void gctl::dsv_io::row_output(std::string name, switch_type_e s)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool gctl::dsv_io::has_column(std::string name)
|
||||||
|
{
|
||||||
|
if (name_index(name) != -1) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int gctl::dsv_io::add_column(std::string name, int idx)
|
int gctl::dsv_io::add_column(std::string name, int idx)
|
||||||
{
|
{
|
||||||
if (idx <= 0) throw std::runtime_error("[gctl::dsv_io] Invalid column index.");
|
if (idx <= 0) throw std::runtime_error("[gctl::dsv_io] Invalid column index.");
|
||||||
@ -678,6 +684,12 @@ int gctl::dsv_io::add_column(std::string name, std::string id_name)
|
|||||||
return add_column(name, name_index(id_name));
|
return add_column(name, name_index(id_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool gctl::dsv_io::has_row(std::string name)
|
||||||
|
{
|
||||||
|
if (name_index(name, true) != -1) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int gctl::dsv_io::add_row(std::string name, int idx)
|
int gctl::dsv_io::add_row(std::string name, int idx)
|
||||||
{
|
{
|
||||||
if (idx <= 0) throw std::runtime_error("[gctl::dsv_io] Invalid row index.");
|
if (idx <= 0) throw std::runtime_error("[gctl::dsv_io] Invalid row index.");
|
||||||
|
@ -491,6 +491,15 @@ namespace gctl
|
|||||||
*/
|
*/
|
||||||
void row_output(std::string name, switch_type_e s = Disable);
|
void row_output(std::string name, switch_type_e s = Disable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 在表格中查找是否存在相应名称的列
|
||||||
|
*
|
||||||
|
* @param name 列名称
|
||||||
|
* @return true 存在该列
|
||||||
|
* @return false 不存在该列
|
||||||
|
*/
|
||||||
|
bool has_column(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 在索引为idx的位置插入一个空白列,剩余列后移一位。如果idx大于列数则在表尾添加一列。
|
* @brief 在索引为idx的位置插入一个空白列,剩余列后移一位。如果idx大于列数则在表尾添加一列。
|
||||||
*
|
*
|
||||||
@ -511,6 +520,15 @@ namespace gctl
|
|||||||
*/
|
*/
|
||||||
int add_column(std::string name, std::string id_name);
|
int add_column(std::string name, std::string id_name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 在表格中查找是否存在相应名称的行
|
||||||
|
*
|
||||||
|
* @param name 行名称
|
||||||
|
* @return true 存在该行
|
||||||
|
* @return false 不存在该行
|
||||||
|
*/
|
||||||
|
bool has_row(std::string name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 在索引为idx的位置插入一个空白行,剩余行后移一位。如果idx大于等于行数则在表尾添加一行。
|
* @brief 在索引为idx的位置插入一个空白行,剩余行后移一位。如果idx大于等于行数则在表尾添加一行。
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user