Ignore any following columns in a CSV file

This commit is contained in:
Patrick Niklaus 2016-08-12 19:12:55 +02:00
parent 087080a6c3
commit 2f6de614c1
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ Feature: Traffic - turn penalties applied to turn onto which a phantom node snap
Scenario: Weighting based on turn penalty file, with an extreme negative value -- clamps and does not fail
Given the turn penalty file
"""
1,2,5,0
1,2,5,0,comment
3,4,7,-20
"""
And the contract extra arguments "--turn-penalty-file penalties.csv"

View File

@ -253,7 +253,7 @@ parse_segment_lookup_from_csv_files(const std::vector<std::string> &segment_spee
// The ulong_long -> uint64_t will likely break on 32bit platforms
const auto ok = parse(it,
last, //
(ulong_long >> ',' >> ulong_long >> ',' >> uint_), //
(ulong_long >> ',' >> ulong_long >> ',' >> uint_ >> *(',' >> *char_)), //
from_node_id,
to_node_id,
speed); //
@ -337,7 +337,7 @@ parse_turn_penalty_lookup_from_csv_files(const std::vector<std::string> &turn_pe
const auto ok =
parse(it,
last, //
(ulong_long >> ',' >> ulong_long >> ',' >> ulong_long >> ',' >> double_), //
(ulong_long >> ',' >> ulong_long >> ',' >> ulong_long >> ',' >> double_ >> *(',' >> *char_)), //
from_node_id,
via_node_id,
to_node_id,