#include <str.h>
Public Member Functions | |
STRING (void) | |
STRING (const STRING &str) | |
~STRING () | |
const char * | GetText (void) |
void | SetText (const char *t) |
void | pr (FILE *fp=stdout) |
Private Attributes | |
char * | text |
All strings in this table are unique. As a result, string comparison can be done my comparing the string pointers.
The usage of this class assumes that the string has been entered in the string table. If the text field is initialized with a string, make sure that the string is entered in the string table (find_string can be called with a STRING argument, in which case it will make a copy of the string pointed to by text).
This class is used by the string table hash table in strtable.h
Definition at line 39 of file str.h.
|
Definition at line 44 of file str.h.
|
|
Definition at line 45 of file str.h.
00046 {
00047 (*this) = str;
00048 } // copy constructor
|
|
Definition at line 49 of file str.h.
00049 { /* do nothing */ }
|
|
Definition at line 51 of file str.h. References text. Referenced by symtable::enter_sym(), type_record::find_elem(), strtable::find_string(), symtable::find_sym(), sym_scope::LookupFromScope(), strtable::new_item(), pr(), symtable::chain_elem::search_list(), and strtable::chain_elem::search_list().
00051 { return text; } |
|
Definition at line 55 of file str.h. References GetText(). Referenced by symtable::pr(), and strtable::pr().
00056 { 00057 fprintf(fp, "%s", GetText() ); 00058 } |
|
Definition at line 53 of file str.h. References text. Referenced by symtable::enter_sym(), strtable::find_string(), symtable::find_sym(), strtable::get_str(), sym_scope::LookupFromScope(), strtable::new_item(), and sym::sym().
00053 { text = (char *)t; } |
|
|