Private メソッド | |
sc_string_rep (int size=16) | |
sc_string_rep (const char *s) | |
sc_string_rep (const char *s, int n) | |
~sc_string_rep () | |
void | resize (int new_size) |
void | set_string (const char *s) |
Private 変数 | |
int | ref_count |
int | alloc |
char * | str |
フレンド | |
class | sc_string_old |
friend::std::ostream & | operator<< (::std::ostream &, const sc_string_old &) |
friend::std::istream & | operator>> (::std::istream &, sc_string_old &) |
sc_string_old | operator+ (const char *, const sc_string_old &) |
sc_string.cpp の 109 行で定義されています。
sc_dt::sc_string_rep::sc_string_rep | ( | int | size = 16 |
) | [inline, private] |
sc_string.cpp の 116 行で定義されています。
00117 { 00118 ref_count = 1; 00119 alloc = sc_roundup( size, 16 ); 00120 str = new char[alloc]; 00121 *str = '\0'; 00122 }
sc_dt::sc_string_rep::sc_string_rep | ( | const char * | s | ) | [inline, private] |
sc_dt::sc_string_rep::sc_string_rep | ( | const char * | s, | |
int | n | |||
) | [private] |
sc_dt::sc_string_rep::~sc_string_rep | ( | ) | [inline, private] |
void sc_dt::sc_string_rep::resize | ( | int | new_size | ) | [private] |
sc_string.cpp の 171 行で定義されています。
00172 { 00173 if (new_size <= alloc) return; 00174 alloc = sc_roundup( new_size, 16 ); 00175 char* new_str = strcpy( new char[alloc], str ); 00176 delete[] str; 00177 str = new_str; 00178 }
void sc_dt::sc_string_rep::set_string | ( | const char * | s | ) | [private] |
friend class sc_string_old [friend] |
sc_string.cpp の 111 行で定義されています。
::std::ostream& operator<< | ( | ::std::ostream & | os, | |
const sc_string_old & | a | |||
) | [friend] |
::std::istream& operator>> | ( | ::std::istream & | is, | |
sc_string_old & | s | |||
) | [friend] |
sc_string.cpp の 638 行で定義されています。
00639 { 00640 if( s.rep->ref_count > 1 ) { 00641 -- s.rep->ref_count; 00642 s.rep = new sc_string_rep; 00643 } 00644 00645 int i = 0; 00646 char* p = s.rep->str; 00647 char c; 00648 00649 // skip white spaces 00650 while( is.get( c ) && isspace( c ) ) 00651 ; 00652 00653 for( ; is.good() && ! isspace( c ); is.get( c ) ) { 00654 if( i > s.rep->alloc - 2 ) { 00655 s.rep->str[i] = '\0'; 00656 s.rep->resize( (int) (s.rep->alloc * 1.5) ); 00657 p = s.rep->str + i; 00658 } 00659 *p ++ = c; 00660 i ++; 00661 } 00662 *p = '\0'; 00663 00664 return is; 00665 }
sc_string_old operator+ | ( | const char * | , | |
const sc_string_old & | ||||
) | [friend] |
sc_string.cpp の 261 行で定義されています。
00262 { 00263 int len = strlen(s); 00264 sc_string_rep* r = new sc_string_rep( len + t.length() + 1 ); 00265 strcpy( r->str, s ); 00266 strcpy( r->str + len, t ); 00267 return sc_string_old(r); 00268 }
int sc_dt::sc_string_rep::ref_count [private] |
sc_string.cpp の 148 行で定義されています。
int sc_dt::sc_string_rep::alloc [private] |
sc_string.cpp の 149 行で定義されています。
char* sc_dt::sc_string_rep::str [private] |
sc_string.cpp の 150 行で定義されています。