tmp
This commit is contained in:
parent
02deea8162
commit
3ca661f9e6
@ -214,28 +214,29 @@ void gctl::dsv_io::load_text(std::string filename, std::string file_exten, int t
|
|||||||
while (std::getline(infile, tmp_line))
|
while (std::getline(infile, tmp_line))
|
||||||
{
|
{
|
||||||
if (tmp_line.empty()) continue; // 跳过空行 空行不会并记入头信息计数中
|
if (tmp_line.empty()) continue; // 跳过空行 空行不会并记入头信息计数中
|
||||||
|
|
||||||
|
// 去掉空格
|
||||||
|
tmp_line.erase(0, tmp_line.find_first_not_of(" \t"));
|
||||||
|
tmp_line.erase(tmp_line.find_last_not_of(" \t") + 1);
|
||||||
|
|
||||||
|
if (h < head_num_) //读入到头信息中
|
||||||
|
{
|
||||||
|
heads_.push_back(tmp_line);
|
||||||
|
h++;
|
||||||
|
}
|
||||||
else if (tmp_line[0] == att_sym_) // 注释行或者标记行 # #!
|
else if (tmp_line[0] == att_sym_) // 注释行或者标记行 # #!
|
||||||
{
|
{
|
||||||
if (tmp_line[1] == tag_sym_) // #!
|
if (tmp_line[1] == tag_sym_) // #!
|
||||||
{
|
{
|
||||||
tmp_line = tmp_line.substr(2); // 去掉前两个字符
|
tmp_line = tmp_line.substr(2); // 去掉前两个字符
|
||||||
tmp_line.erase(0, tmp_line.find_first_not_of(" \t"));
|
|
||||||
tmp_line.erase(tmp_line.find_last_not_of(" \t") + 1);
|
|
||||||
tags_.push_back(tmp_line);
|
tags_.push_back(tmp_line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #
|
// #
|
||||||
tmp_line = tmp_line.substr(1); // 去掉第一个字符
|
tmp_line = tmp_line.substr(1); // 去掉第一个字符
|
||||||
tmp_line.erase(0, tmp_line.find_first_not_of(" \t"));
|
|
||||||
tmp_line.erase(tmp_line.find_last_not_of(" \t") + 1);
|
|
||||||
annotates_.push_back(tmp_line);
|
annotates_.push_back(tmp_line);
|
||||||
}
|
}
|
||||||
else if (h < head_num_) //读入到头信息中
|
|
||||||
{
|
|
||||||
heads_.push_back(tmp_line);
|
|
||||||
h++;
|
|
||||||
}
|
|
||||||
else lines.push_back(tmp_line);
|
else lines.push_back(tmp_line);
|
||||||
}
|
}
|
||||||
infile.close();
|
infile.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user