$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
From: steven_at_[hidden]
Date: 2008-06-21 19:42:36
Author: steven_watanabe
Date: 2008-06-21 19:42:36 EDT (Sat, 21 Jun 2008)
New Revision: 46596
URL: http://svn.boost.org/trac/boost/changeset/46596
Log:
Added missing file
Added:
   sandbox/tools/profile_templates/src/filter.cpp   (contents, props changed)
Added: sandbox/tools/profile_templates/src/filter.cpp
==============================================================================
--- (empty file)
+++ sandbox/tools/profile_templates/src/filter.cpp	2008-06-21 19:42:36 EDT (Sat, 21 Jun 2008)
@@ -0,0 +1,35 @@
+#include <string>
+#include <cstdio>
+
+const char* search("template_profiler");
+
+int main() {
+    std::string buffer;
+    int ch;
+    int pos = 0;
+    bool matched = false;
+    int counter = 0;
+    while((ch = std::getchar()) != EOF) {
+        buffer.push_back(ch);
+        if(ch == '\n') {
+            if(matched) {
+                for(int i = 0; i < buffer.size(); ++i) {
+                    std::putchar(buffer[i]);
+                }
+                if(++counter % 100 == 0) {
+                    std::fprintf(stderr, "On Instantiation %d\n", counter);
+                }
+            }
+            buffer.clear();
+            matched = false;
+        }
+        if(ch == search[pos]) {
+            ++pos;
+            if(search[pos] == '\0') {
+                matched = true;
+            }
+        } else {
+            pos = 0;
+        }
+    }
+}