diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-18 21:54:25 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-05-18 21:54:25 +0000 |
commit | eb91ee2d4a8115858376ed2d5aaad65b045743d4 (patch) | |
tree | 5490ae8b79b7a44077e026502b0efc39a999bcca /ace/SString.h | |
parent | b67e22b92f71397caf1c0e0bb11673700c011bf5 (diff) | |
download | ATCD-eb91ee2d4a8115858376ed2d5aaad65b045743d4.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace/SString.h')
-rw-r--r-- | ace/SString.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ace/SString.h b/ace/SString.h index ea49879328d..72f1d2fa8ba 100644 --- a/ace/SString.h +++ b/ace/SString.h @@ -51,10 +51,10 @@ public: ACE_CString (ACE_Allocator *alloc = 0); // Default constructor. - ACE_CString (const char *s, ACE_Allocator *alloc = 0); + ACE_CString (const char *s, ACE_Allocator *alloc = 0, int release = 1); // Constructor that copies <s> into dynamically allocated memory. - ACE_CString (const char *s, size_t len, ACE_Allocator *alloc = 0); + ACE_CString (const char *s, size_t len, ACE_Allocator *alloc = 0, int release = 1); // Constructor that copies <len> chars of <s> into dynamically // allocated memory (will NUL terminate the result). @@ -71,7 +71,7 @@ public: ~ACE_CString (void); // Deletes the memory... - char operator[] (size_t index) const; + const char &operator[] (size_t index) const; // Return the <index'th> character in the string (doesn't perform // bounds checking). @@ -82,10 +82,10 @@ public: ACE_CString &operator= (const ACE_CString &); // Assignment operator (does copy memory). - void set (const char *s); + void set (const char *s, int release = 1); // Copy <s> - void set (const char *s, size_t len); + void set (const char *s, size_t len, int release = 1); // Copy <len> bytes of <s> (will NUL terminate the result) ACE_CString substring (size_t offset, ssize_t length = -1) const; @@ -161,6 +161,9 @@ private: char *rep_; // Pointer to data. + int release_; + // Flag that indicates if we own the memory + static char NULL_CString_; // Represents the "NULL" string to simplify the internal logic. }; |