[opengtl-commits] [721] add the possibility to display functions

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


Revision: 721
Author:   cyrille
Date:     2009-04-11 15:52:08 +0200 (Sat, 11 Apr 2009)

Log Message:
-----------
add the possibility to display functions

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/Debug.cpp
    trunk/OpenGTL/OpenGTL/GTLCore/Debug.h


Modified: trunk/OpenGTL/OpenGTL/GTLCore/Debug.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Debug.cpp	2009-04-11 12:42:30 UTC (rev 720)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Debug.cpp	2009-04-11 13:52:08 UTC (rev 721)
@@ -26,6 +26,7 @@
 #include <llvm/Type.h>
 #include <llvm/System/Path.h>
 
+#include "Function.h"
 #include "ExpressionResult_p.h"
 #include "Macros_p.h"
 #include "PixelDescription.h"
@@ -35,6 +36,7 @@
 #include "Type.h"
 #include "Type_p.h"
 #include "Value.h"
+#include "Parameter.h"
 
 using namespace GTLCore;
 
@@ -355,6 +357,22 @@
     }
     return ostr;
   }
+  std::ostream& operator<< (std::ostream& ostr, const Function& function)
+  {
+    ostr << function.name() << " : " << *function.returnType() << " ( ";
+    
+    for( std::size_t i = 0; i < function.parameters().size(); ++i )
+    {
+      ostr << *function.parameters()[i].type();
+      if( i != function.parameters().size() - 1 )
+      {
+        ostr << ", ";
+      }
+    }
+    
+    ostr << " )";
+    return ostr;
+  }
 
 }
 

Modified: trunk/OpenGTL/OpenGTL/GTLCore/Debug.h
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/Debug.h	2009-04-11 12:42:30 UTC (rev 720)
+++ trunk/OpenGTL/OpenGTL/GTLCore/Debug.h	2009-04-11 13:52:08 UTC (rev 721)
@@ -39,6 +39,7 @@
       struct Private;
   };
   class ExpressionResult;
+  class Function;
   class PixelDescription;
   class Region;
   class ScopedName;
@@ -53,6 +54,7 @@
   std::ostream& operator<< (std::ostream& ostr, const Type& type);
   std::ostream& operator<< (std::ostream& ostr, const Token& token);
   std::ostream& operator<< (std::ostream& ostr, const Value& value);
+  std::ostream& operator<< (std::ostream& ostr, const Function& function);
 }
 
 


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