Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

idep_string.h

Go to the documentation of this file.
00001 // idep_string.h
00002 #ifndef INCLUDED_IDEP_STRING
00003 #define INCLUDED_IDEP_STRING
00004 
00005 // This leaf component defines 1 class:
00006 //   idep_String: managed character string 
00007 
00008 // Note: the behavior resulting from passing a null pointer as an argument
00009 // to any function in this component is undefined.
00010 
00011 class idep_String {
00012     char *d_string_p;
00013 
00014   public:
00015     // CREATORS
00016     idep_String();
00017     idep_String(const idep_String& idep_string);
00018     idep_String(const char *str);
00019     ~idep_String();
00020 
00021     // MANIPUALTORS
00022     idep_String &operator=(const idep_String& idep_string);
00023     idep_String &operator=(const char* str);
00024 
00025     idep_String& operator+=(const idep_String& idep_string);
00026     idep_String& operator+=(const char* str);
00027         // Concatenate to this string object.
00028 
00029     // ACCESSORS
00030     operator const char*() const;
00031         // Return a pointer to the fundamental null-terminated string 
00032         // representation.  Note: this pointer is valid only until this 
00033         // object is modified or destroyed.
00034 
00035     int length() const;
00036         // Return the length of the current string.  Note that the use of this 
00037         // function enables clients to efficiently exploit a wider variety of 
00038         // implementation alternatives for this class.
00039 };
00040 
00041 // FREE OPERATORS
00042 
00043 idep_String operator+(const idep_String& idep_string, const char *str);
00044 idep_String operator+(const char* str, const idep_String& idep_string);
00045 idep_String operator+(const idep_String& left, const idep_String& right);
00046     // Concatenation: three variations to avoid ambiguity and for efficiency.
00047 
00048 int operator==(const idep_String& left, const idep_String& right);
00049 int operator!=(const idep_String& left, const idep_String& right);
00050 int operator> (const idep_String& left, const idep_String& right);
00051 int operator>=(const idep_String& left, const idep_String& right);
00052 int operator< (const idep_String& left, const idep_String& right);
00053 int operator<=(const idep_String& left, const idep_String& right);
00054     // Lexicographic comparison: (const idep_String&) and (const idep_String&).
00055 
00056 int operator==(const idep_String& idep_string, const char *str);
00057 int operator!=(const idep_String& idep_string, const char *str);
00058 int operator> (const idep_String& idep_string, const char *str);
00059 int operator>=(const idep_String& idep_string, const char *str);
00060 int operator< (const idep_String& idep_string, const char *str);
00061 int operator<=(const idep_String& idep_string, const char *str);
00062     // Lexicographic comparison: (const idep_String&) and (const char *).
00063 
00064 int operator==(const char* str, const idep_String& idep_string);
00065 int operator!=(const char* str, const idep_String& idep_string);
00066 int operator> (const char* str, const idep_String& idep_string);
00067 int operator>=(const char* str, const idep_String& idep_string);
00068 int operator< (const char* str, const idep_String& idep_string);
00069 int operator<=(const char* str, const idep_String& idep_string);
00070     // Lexicographic comparison: (const char *) and (const idep_String&).
00071 
00072 # endif
00073 

Generated on Mon Feb 15 11:06:48 2010 for loon by  doxygen 1.3.9.1