From 10834cdea4d863520725933d0d94655497a3679b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Oct 2008 17:11:01 +0000 Subject: [PATCH] Merged in comment split code from the old flt plugin so that FLT comments string with returns in them are put into separate description entries. --- .../OpenFlight/AncillaryRecords.cpp | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/OpenFlight/AncillaryRecords.cpp b/src/osgPlugins/OpenFlight/AncillaryRecords.cpp index dfc4e3898..b299a1fee 100644 --- a/src/osgPlugins/OpenFlight/AncillaryRecords.cpp +++ b/src/osgPlugins/OpenFlight/AncillaryRecords.cpp @@ -44,10 +44,43 @@ class Comment : public Record virtual void readRecord(RecordInputStream& in, Document& /*document*/) { std::streamsize size = in.getRecordSize(); - std::string comment = in.readString(size-4); + std::string commentfield = in.readString(size-4); if (_parent.valid()) - _parent->setComment(comment); + { +#if 0 + _parent->setComment(commentfield); +#else + unsigned int front_of_line = 0; + unsigned int end_of_line = 0; + while (end_of_linesetComment( std::string( commentfield, front_of_line, end_of_line-front_of_line) ); + + if (end_of_line+1setComment( std::string( commentfield, front_of_line, end_of_line-front_of_line) ); + ++end_of_line; + front_of_line = end_of_line; + } + else ++end_of_line; + } + if (front_of_linesetComment( std::string( commentfield, front_of_line, end_of_line-front_of_line) ); + } + + } +#endif + } };