]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/string-handle.icc
* flower
[lilypond.git] / flower / include / string-handle.icc
index aed19027d00cee907a5d709041bcabc3c60adb41..91af2c56d36986c14e9f8a4d79f4aee5fdc42b59 100644 (file)
@@ -1,10 +1,10 @@
 /* -*-c++-*-
-   
-  stringhandle.inl -- implement String_handle
 
-  source file of Flower lib
+stringhandle.inl -- implement String_handle
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+source file of Flower lib
+
+(c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #ifndef STRINGHANDLE_INL
 #include "string-data.hh"
 #include "string-handle.hh"
 
-INLINE void 
-String_handle::down () 
-{ 
+INLINE void
+String_handle::down ()
+{
   if (! (--data->ref_count_))
     delete data;
-  data = 0; 
+  data = 0;
 }
 
 /*
@@ -30,15 +30,15 @@ String_handle::down ()
 
   THIS does not have to be initialized.
 */
-INLINE void 
-String_handle::up (String_data *d) 
-{ 
-  data=d;
-  data->ref_count_ ++; 
+INLINE void
+String_handle::up (String_data *d)
+{
+  data = d;
+  data->ref_count_++;
 }
 
-INLINE void 
-String_handle::copy () 
+INLINE void
+String_handle::copy ()
 {
   if (data->ref_count_ !=1)
     {
@@ -49,51 +49,51 @@ String_handle::copy ()
 }
 
 INLINE
-String_handle::String_handle () 
+String_handle::String_handle ()
 {
   up (new String_data);
 }
 
 INLINE
-String_handle::~String_handle () 
-{      
+String_handle::~String_handle ()
+{
   down ();
-}    
+}
 
 INLINE
-String_handle::String_handle (String_handle const & src) 
-{      
+String_handle::String_handle (String_handle const &src)
+{
   up (src.data);
 }
 
-INLINE Byte
-String_handle::get_bytes () 
+INLINE Byte *
+String_handle::get_bytes ()
 {
   copy ();
   return data->get_bytes ();
 }
 
-INLINE char
-String_handle::get_str0 () 
+INLINE char *
+String_handle::get_str0 ()
 {
   copy ();
-  return (char*)data->get_bytes ();
+  return (char *)data->get_bytes ();
 }
 
-INLINE Byte 
-const* String_handle::to_bytes () const 
+INLINE Byte
+const *String_handle::to_bytes () const
 {
   return data->to_bytes ();
 }
 
-INLINE char const
-String_handle::to_str0 () const 
+INLINE char const *
+String_handle::to_str0 () const
 {
-  return (char const*)data->to_bytes ();
+  return (char const *)data->to_bytes ();
 }
 
-INLINE void 
-String_handle::operator = (String_handle const &src) 
+INLINE void
+String_handle::operator= (String_handle const &src)
 {
   if (this == &src)
     return;
@@ -101,64 +101,64 @@ String_handle::operator = (String_handle const &src)
   up (src.data);
 }
 
-INLINE void 
-String_handle::operator += (char const *s) 
-{      
+INLINE void
+String_handle::operator+= (char const *s)
+{
   copy ();
   *data += s;
-}    
-
+}
 
-INLINE Byte 
-String_handle::operator[] (int j) const 
-{ 
-  return (*data)[j]; 
+INLINE Byte
+String_handle::operator[] (int j) const
+{
+  return (*data)[j];
 }
 
 // !NOT SAFE!
 // don't use this for loops. Use to_bytes ()
 INLINE Byte &
-String_handle::operator[] (int j) 
+String_handle::operator[] (int j)
 {
   copy ();     // hmm. Not efficient
   return data->get_bytes ()[j];
 }
 
-INLINE void 
-String_handle::append (Byte const* byte, int length_i) 
+INLINE void
+String_handle::append (Byte const *byte, int length_i)
 {
   copy ();
   data->append (byte, length_i);
 }
-                          
-INLINE void 
-String_handle::set (Byte const* byte, int length_i) 
+
+INLINE void
+String_handle::set (Byte const *byte, int length_i)
 {
   copy ();
   data->set (byte, length_i);
 }
-                          
-INLINE void 
-String_handle::operator = (char const *p) 
+
+INLINE void
+String_handle::operator= (char const *p)
 {
   copy ();
   data->set (p);
 }
-                          
-INLINE void 
-String_handle::trunc (int j) 
+
+INLINE void
+String_handle::trunc (int j)
 {
-  copy (); data->trunc (j); 
+  copy (); data->trunc (j);
 }
 
-INLINE int 
-String_handle::length () const 
-{ 
-  return data->length_; 
+INLINE int
+String_handle::length () const
+{
+  return data->length_;
 }
 
 INLINE bool
-String_handle::is_binary_bo () const {
+String_handle::is_binary_bo () const
+{
   return data->is_binary_bo ();
 }