Commit aae646ea authored by Purves, Murray's avatar Purves, Murray
Browse files

Trimming descriptor strings on read

parent 8f3aa801
......@@ -207,30 +207,30 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
split_string(std::string(1, delim), trim_string(buffer));
if (bufferItems.size() > 0)
{
title = bufferItems[0];
title = trim_string(bufferItems[0]);
}
if (bufferItems.size() > 1)
{
description = bufferItems[1];
description = trim_string(bufferItems[1]);
}
if (bufferItems.size() > 2)
{
source = bufferItems[2];
source = trim_string(bufferItems[2]);
}
}
else
{
// Splitting evenly (60 characters each)
radix_line(" Splitting evenly (60 chars per item)...");
title = buffer.substr(0, 59);
description = buffer.substr(60, 119);
source = buffer.substr(120, 179);
title = trim_string(buffer.substr(0, 59));
description = trim_string(buffer.substr(60, 119));
source = trim_string(buffer.substr(120, 179));
}
radix_line(" title: " << title);
radix_line(" description: " << description);
radix_line(" source: " << source);
// Date/time
std::string dateTime = stream.readString(23);
std::string dateTime = trim_string(stream.readString(23));
radix_line(" date/time: " << dateTime);
// Tag
std::string tag = stream.readString(1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment