Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
aae646ea
Commit
aae646ea
authored
Oct 09, 2018
by
Purves, Murray
Browse files
Trimming descriptor strings on read
parent
8f3aa801
Changes
1
Hide whitespace changes
Inline
Side-by-side
radixio/spectrumpcfstream.i.hh
View file @
aae646ea
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment