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 int main(int argc, char const *argv[]) try
{ {
text_content tc; text_content tc;
tc.load_text("tmp/sample", ".txt", HasColumnName); tc.set_delimeter('|');
tc.load_text("tmp/world_data", ".txt", HasColumnName);
tc.info(); tc.info();
_1s_array name;
tc.get_column("Name_s", name);
name.show(std::cout, ',');
/* /*
text_content tc("tmp/topo", ".txt", HasColumnName); text_content tc("tmp/topo", ".txt", HasColumnName);

View File

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