X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fstring-handle.hh;h=25caad3fd1b5d9807f5e05c92edac217ba9883a7;hb=caae40c5780a1fced18472977250e9d96e5ee22f;hp=3f42e860e66ee5e20f8b82fb1c14f3480850c857;hpb=8309cbcd6660ea1f0b35abacbb424ddc4158e448;p=lilypond.git diff --git a/flower/include/string-handle.hh b/flower/include/string-handle.hh index 3f42e860e6..25caad3fd1 100644 --- a/flower/include/string-handle.hh +++ b/flower/include/string-handle.hh @@ -3,13 +3,14 @@ source file of the LilyPond music typesetter - (c) 1997 Han-Wen Nienhuys + (c) 1997--2004 Han-Wen Nienhuys */ #ifndef STRINGHANDLE_HH #define STRINGHANDLE_HH -#include "fproto.hh" + +#include "flower-proto.hh" /** @@ -20,49 +21,48 @@ */ class String_handle { - String_data* data; + String_data* data; - /// decrease ref count. Named kind of like a Tanenbaum semafore - void down(); + /// decrease ref count. Named kind of like a Tanenbaum semafore + void down (); - /// increase ref count - void up(String_data *d); + void up (String_data *d); - /** make sure data has only one reference. - POST: data->references == 1 - */ - void copy(); + /** 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 (); + String_handle (String_handle const & src); - Byte const* byte_C() const; - char const* ch_C() const; - Byte* byte_l(); - char* ch_l(); - bool is_binary_bo()const; - void operator =(String_handle const &src); - void operator += (char const *s); - Byte operator[](int j) const; + 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); + Byte operator[] (int j) const; - /** Access elements. WARNING: NOT SAFE - don't use this for loops. Use byte_C() - */ - Byte &operator[](int j); - void append( Byte const* byte_C, int length_i ); - void set( Byte const* byte_C, int length_i ); - void operator = (char const *p); - void trunc(int j); - int length_i() const; + /** Access elements. WARNING: NOT SAFE + don't use this for loops. Use to_bytes () + */ + Byte &operator[] (int j); + 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; }; #ifdef STRING_UTILS_INLINED #ifndef INLINE #define INLINE inline #endif -#include "string-handle.inl" +#include "string-handle.icc" /* we should be resetting INLINE. oh well. */ #endif