[opengtl-commits] [755] add a function to return error messages

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 755
Author:   cyrille
Date:     2009-05-30 12:19:29 +0200 (Sat, 30 May 2009)

Log Message:
-----------
add a function to return error messages

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/Template.cpp
    trunk/OpenGTL/OpenCTL/OpenCTL/Template.h


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Template.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Template.cpp	2009-05-30 09:46:05 UTC (rev 754)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Template.cpp	2009-05-30 10:19:29 UTC (rev 755)
@@ -113,3 +113,13 @@
   module->setSource(generateSource(_namedTypes, _pixelDescription));
   return module;
 }
+
+GTLCore::String Template::compilationErrorsMessage() const {
+  std::ostringstream os;
+  for( std::list<GTLCore::ErrorMessage>::iterator it = d->errorMessages.begin();
+       it != d->errorMessages.end(); ++it)
+  {
+    os << it->fileName() << " at " << it->line() << " : " << it->errorMessage()  << std::endl;
+  }
+  return os.str();
+}

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/Template.h
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/Template.h	2009-05-30 09:46:05 UTC (rev 754)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/Template.h	2009-05-30 10:19:29 UTC (rev 755)
@@ -55,6 +55,10 @@
        */
       Module* generateModule( const std::map< GTLCore::String, const GTLCore::Type* >& _namedTypes,
                         const GTLCore::PixelDescription& _pixelDescription );
+      /**
+       * @return a string with the content of the compilation error.
+       */
+      GTLCore::String compilationErrorsMessage() const;
     private:
       struct Private;
       Private* const d;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/