]> git.donarmstrong.com Git - lilypond.git/commitdiff
flower-1.0.5
authorfred <fred>
Tue, 5 Nov 1996 16:49:36 +0000 (16:49 +0000)
committerfred <fred>
Tue, 5 Nov 1996 16:49:36 +0000 (16:49 +0000)
flower/Sources.make
flower/assoc.hh
flower/dstream.cc
flower/dstream.hh

index fd5dcf414610946561df2d31cc895c13fbdbf14e..e8b2250ad199c7f4a3e8d97fab79957e8e3af58c 100644 (file)
@@ -9,4 +9,5 @@ hh=cursor.hh pcursor.hh lgetopt.hh link.hh list.hh dstream.hh \
        string.hh stringutil.hh vray.hh textdb.hh textstr.hh  assoc.hh\
        findcurs.hh unionfind.hh compare.hh handle.hh matrix.hh\
        smat.hh vsmat.hh  vector.hh  real.hh choleski.hh\
-       tsmat.hh tvsmat.hh plist.hh\
+       tsmat.hh tvsmat.hh plist.hh associter.hh\
+
index 84a54c9a72bb4a61fc86e3da89adff02130973a3..24099856688d920bf7b1f776bc922215e6ee4426 100644 (file)
@@ -2,6 +2,7 @@
 #define ASSOC_HH
 
 #include "vray.hh"
+#include <assert.h>
 
 template<class K,class V>
 struct Assoc_ent_ {
@@ -72,4 +73,5 @@ public:
 };
 /** mindblowingly stupid Associative array implementation
  */
+
 #endif
index d8cff690414128eb2154c815c736634b520fbfa8..8540e734cffd29c1ee144b7162d72dc4af405111 100644 (file)
@@ -1,5 +1,5 @@
 #include <fstream.h>
-
+#include "assoc.hh"
 #include "dstream.hh"
 #include "string.hh"
 #include "textdb.hh"
@@ -36,14 +36,14 @@ Dstream::identify_as(String name)
     String cl(strip_member(mem));
     String idx = cl;
     
-    if (silent.elt_query(mem))
+    if (silent->elt_query(mem))
        idx  = mem;
-    else if (silent.elt_query(cl))
+    else if (silent->elt_query(cl))
        idx = cl;
     else {
-       silent[idx] = false;
+       (*silent)[idx] = false;
     }
-    local_silence = silent[idx];
+    local_silence = (*silent)[idx];
     if (classname != idx && !local_silence) {
        classname=idx;
        *os << "[" << classname << ":]";
@@ -54,9 +54,9 @@ Dstream::identify_as(String name)
 bool
 Dstream::silence(String s)
 {
-    if (!silent.elt_query(s))
+    if (!silent->elt_query(s))
        return false;
-    return silent[s];
+    return (*silent)[s];
 }
 ///
 Dstream &
@@ -99,6 +99,7 @@ Dstream::operator<<(String s)
 Dstream::Dstream(ostream *r, const char * cfg_nm )
 {
     os = r;
+    silent = new Assoc<String,bool>;
     if (!os)
        return;
     indentlvl = 0;
@@ -109,15 +110,18 @@ Dstream::Dstream(ostream *r, const char * cfg_nm )
        if (!ifs)
            return;
     }
-    //    cerr << "(" << fn;
+
     Text_db cfg(fn);
     while (! cfg.eof()){            
         Text_record  r(  cfg++);
         assert(r.sz() == 2);
-        silent[r[0]] = r[1].to_bool();
+        (*silent)[r[0]] = r[1].to_bool();
     }
-    //  cerr <<")";
-}
 
+}
 
 
+Dstream::~Dstream()
+{
+    delete silent;
+}
index 72d0897201a5210fc63aec7700b9c22161add756..aae52a7838c5fda5b03fdb079b844465a162d9c0 100644 (file)
@@ -4,10 +4,12 @@
 #define DSTREAM_HH
 
 #include "string.hh"
-#include "assoc.hh"
 
 const char eol= '\n';
 
+template<class K,class V>
+struct Assoc;
+
 /// debug stream
 class Dstream
 {
@@ -16,7 +18,7 @@ class Dstream
     bool local_silence;
     String classname;
 
-    Assoc<String, bool> silent;
+    Assoc<String, bool> *silent;
 public:
 
     bool silence(String);