This commit is contained in:
张壹 2024-12-13 11:02:59 +08:00
parent b13872843b
commit 7259485f7d
2 changed files with 14 additions and 4 deletions

View File

@ -33,9 +33,14 @@ using namespace gctl;
int main(int argc, char const *argv[]) try
{
text_content tc;
tc.load_text("tmp/sample", ".txt", HasColumnName);
tc.set_delimeter('|');
tc.load_text("tmp/world_data", ".txt", HasColumnName);
tc.info();
_1s_array name;
tc.get_column("Name_s", name);
name.show(std::cout, ',');
/*
text_content tc("tmp/topo", ".txt", HasColumnName);

View File

@ -38,11 +38,16 @@ namespace gctl
std::string str_;
template <typename T> T value()
{
// 如果输出也是字符串 就直接赋值即可避免l_str中含有空格会出现bug
if constexpr (std::is_same<T, std::string>::value) return str_;
else
{
T out;
str2type(str_, out);
return out;
}
}
template <typename T> void value(const T &in)
{