]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/string-handle.hh
* flower
[lilypond.git] / flower / include / string-handle.hh
index c9cd7f384b0f70e4cef6f63d16911fd9772d9c35..32810219d6b3d7f27c8fe1ada00da26ce4b414f0 100644 (file)
@@ -6,54 +6,52 @@
   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #ifndef STRINGHANDLE_HH
 #define STRINGHANDLE_HH
 
 #include "flower-proto.hh"
 
-
 /**
-  Reference counting for strings.
-  
+   Reference counting for strings.
+
    handles ref. counting, and provides a very thin interface using
    Byte *
+*/
+class String_handle
+{
+  String_data *data;
 
-   */
-class String_handle {
-  String_data* data;
-    
   /// decrease ref count. Named kind of like a Tanenbaum semafore 
   void down ();
 
   void up (String_data *d);
-    
-  /** make sure data has only one reference.      
+
+  /** make sure data has only one reference.
       POST: data->ref_count_ == 1
   */
   void copy ();
-    
+
 public:
   String_handle ();
   ~String_handle ();
-  String_handle (String_handle const & src);
+  String_handle (String_handle const &src);
 
-  Byte constto_bytes () const;
-  char constto_str0 () const;
-  Byteget_bytes ();
-  char* get_str0 ();    
+  Byte const *to_bytes () const;
+  char const *to_str0 () const;
+  Byte *get_bytes ();
+  char *get_str0 ();
   bool is_binary_bo () const;
-  void operator = (String_handle const &src);
-  void operator += (char const *s);
+  void operator= (String_handle const &src);
+  void operator+= (char const *s);
   Byte operator[] (int j) const;
 
   /** Access elements. WARNING: NOT SAFE
       don't use this for loops. Use to_bytes ()
   */
   Byte &operator[] (int j);
-  void append (Byte constbyte, int length_i);
-  void set (Byte constbyte, int length_i);
-  void operator = (char const *p);
+  void append (Byte const *byte, int length_i);
+  void set (Byte const *byte, int length_i);
+  void operator= (char const *p);
   void trunc (int j);
   int length () const;
 };
@@ -66,5 +64,4 @@ public:
 /* we should be resetting INLINE. oh well. */
 #endif
 
-
 #endif // STRINGHANDLE_HH