summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael@kerber-sls.de <michael@kerber-sls.de@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-03-28 18:41:49 +0000
committermichael@kerber-sls.de <michael@kerber-sls.de@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-03-28 18:41:49 +0000
commit21a0ff691cd5470aa7e8ddee01ee45142679b3c0 (patch)
tree37dabf26a26ea6beef63db76845c5086863c419d
parent2fef8017dd279bae5326068b3c5aa763a4788d81 (diff)
Made read_ascii more tolerant wrt whitespaces
git-svn-id: https://phat.googlecode.com/svn/trunk@10 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
-rw-r--r--include/phat/boundary_matrix.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/phat/boundary_matrix.h b/include/phat/boundary_matrix.h
index 63c0dc4..6700b3d 100644
--- a/include/phat/boundary_matrix.h
+++ b/include/phat/boundary_matrix.h
@@ -166,9 +166,12 @@ namespace phat {
return false;
index number_of_columns = 0;
- while( getline( dummy, cur_line ) )
+ while( getline( dummy, cur_line ) ) {
+ cur_line.erase(cur_line.find_last_not_of(" \t\n\r\f\v") + 1);
if( cur_line != "" && cur_line[ 0 ] != '#' )
number_of_columns++;
+
+ }
this->set_num_cols( number_of_columns );
dummy.close();
@@ -179,6 +182,7 @@ namespace phat {
column temp_col;
index cur_col = -1;
while( getline( input_stream, cur_line ) ) {
+ cur_line.erase(cur_line.find_last_not_of(" \t\n\r\f\v") + 1);
if( cur_line != "" && cur_line[ 0 ] != '#' ) {
cur_col++;
std::stringstream ss( cur_line );