]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.46.jcn1
authorfred <fred>
Sun, 24 Mar 2002 19:37:34 +0000 (19:37 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:37:34 +0000 (19:37 +0000)
flower/include/cursor.hh
flower/include/cursor.icc [new file with mode: 0644]
flower/include/link.hh
flower/include/list.hh
flower/include/plist.hh
flower/include/plist.icc [new file with mode: 0644]
flower/include/string-handle.hh
flower/stringutil.cc

index af2e251a087a2729bbd2055751b51eb970b7771d..168ee50393daacc0a9b93390054904bfe0278232 100644 (file)
@@ -107,7 +107,7 @@ template_instantiate_compare(Cursor<T>, Cursor<T>::compare, template<class T>);
 
 #include "pcursor.hh"
 #include "list.hh"
-#include "cursor.inl"
+#include "cursor.icc"
 #include "iterate.hh"
 
 #endif // CURSOR_HH 
diff --git a/flower/include/cursor.icc b/flower/include/cursor.icc
new file mode 100644 (file)
index 0000000..e103c88
--- /dev/null
@@ -0,0 +1,113 @@
+ // cursor.icc -*-c++-*-
+#ifndef CURSOR_INL
+#define CURSOR_INL
+#include <assert.h>
+
+
+template<class T>
+inline
+Cursor<T>::Cursor( const List<T>& list, Link<T>* pointer ) : 
+    list_((List<T>&) list )
+{
+    if ( list.size() )
+        pointer_ = pointer ? pointer : list.top_;
+    else
+        pointer_ = pointer;
+}
+
+template<class T>
+inline
+Cursor<T>::Cursor( const Cursor<T>& cursor ) :
+    list_( cursor.list_ )
+{
+    pointer_ = cursor.pointer_;
+}
+
+template<class T>
+inline T&
+Cursor<T>::thing()
+{
+    assert( pointer_ );
+    return pointer_->thing();
+}
+
+template<class T>
+Cursor<T>
+Cursor<T>::operator =( const Cursor<T>& c )
+{   
+    assert( &list_ == &c.list_ );
+    pointer_ = c.pointer_;
+    return *this;
+}
+
+template<class T>
+inline void
+Cursor<T>::add( const T& th )
+{
+    list_.add( th, *this );
+}
+
+template<class T>
+inline void
+Cursor<T>::insert( const T& th )
+{
+    list_.insert( th, *this );
+}
+
+template<class T>
+inline  List<T>&
+Cursor<T>::list() const
+{
+    return list_;
+}
+
+template<class T>
+inline Link<T>*
+Cursor<T>::pointer()
+{
+    return pointer_;
+}
+
+template<class T>
+inline bool
+Cursor<T>::backward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::forward()
+{
+    return ( pointer_ != 0 );
+}
+
+template<class T>
+inline bool
+Cursor<T>::ok()
+{
+    return ( pointer_ != 0 );
+}
+
+
+template<class T>
+inline Cursor<T> 
+Cursor<T>::operator ++( int )    
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->next();
+    return r;
+}
+
+template<class T>
+inline Cursor<T>
+Cursor<T>::operator --( int )
+{
+    Cursor<T> r (*this);
+    assert( pointer_ );
+    pointer_ = pointer_->previous();
+    return r;
+}
+
+#endif
index 22fcec4e71c905b6e17e528deac57cc8f075c046..218a0f8e55b8a988709a98b279ece6bbc022e53a 100644 (file)
@@ -33,6 +33,6 @@ private:
     Link<T>* next_;
 };
 
-#include "link.inl"
+#include "link.icc"
 
 #endif // __LINK_HH //
index fbb79e6edf79b031cd79670cba2aafd54a691e3e..1cfa9f54edf397e88753ce3ab42f62cfffed02d7 100644 (file)
@@ -83,7 +83,7 @@ class List
     Link<T>* bottom_;
 };
 
-#include "list.inl"
+#include "list.icc"
 #include "cursor.hh"
 
 // instantiate a template:  explicit instantiation.
index f9af4c693b662bfd2f8812e5fd397e39f9b2d500..1fc4d941ab0851e6890a32c92cc10b8915247700 100644 (file)
@@ -67,6 +67,6 @@ void PL_copy(IPointerList<T*> &dst,IPointerList<T*> const&src);
 #define IPL_instantiate(a) PL_instantiate(a); \
        template class IPointerList<a*>
 
-#include "plist.inl"
+#include "plist.icc"
 
 #endif
diff --git a/flower/include/plist.icc b/flower/include/plist.icc
new file mode 100644 (file)
index 0000000..8b5f8ee
--- /dev/null
@@ -0,0 +1,21 @@
+/* -*-c++-*-
+  plist.icc -- part of flowerlib
+
+  (c) 1996 Han-Wen Nienhuys& Jan Nieuwenhuizen
+*/
+
+#ifndef PLIST_INL
+#define PLIST_INL
+
+template<class T>
+void
+PL_copy(IPointerList<T*> &to, IPointerList<T*> const&src)
+{
+    for (PCursor<T*> pc(src); pc.ok(); pc++) {
+       T *q = pc;
+       T *p=new T(*q) ; 
+       to.bottom().add(p);
+    }
+}
+
+#endif
index 3f42e860e66ee5e20f8b82fb1c14f3480850c857..88954cb1683a2e616eb75caeff8e705e0e46f615 100644 (file)
@@ -60,9 +60,9 @@ public:
 
 #ifdef STRING_UTILS_INLINED
 #ifndef INLINE
-#define INLINE inline
+#define INLINE.iccine
 #endif
-#include "string-handle.inl"
+#include "string-handle.icc"
 /* we should be resetting INLINE. oh well. */
 #endif
 
index 43c8e15d8259b8a309ce8363fc8b07b03f86f0cf..d73e4f14d374930e3479c2d30bd43c1030832eff 100644 (file)
@@ -29,5 +29,5 @@ mymemmove( void* dest, void const* src, size_t n )
 
 #include "string-handle.hh"
 #include "string-data.hh"
-#include "string-data.inl"
-#include "string-handle.inl"
+#include "string-data.icc"
+#include "string-handle.icc"