クラス sc_dt::scfx_string

#include <scfx_string.h>

すべてのメンバ一覧

Public メソッド

 scfx_string ()
 ~scfx_string ()
int length () const
void clear ()
char & operator[] (int)
void append (int)
void discard (int)
void remove (int)
void operator+= (char)
void operator+= (const char *)
 operator const char * ()

Private メソッド

void resize (std::size_t)

Private 変数

std::size_t m_len
std::size_t m_alloc
char * m_buffer


説明

scfx_string.h75 行で定義されています。


コンストラクタとデストラクタ

sc_dt::scfx_string::scfx_string (  )  [inline]

scfx_string.h131 行で定義されています。

00132 : m_len( 0 ), m_alloc( BUFSIZ ), m_buffer( new char[m_alloc] )
00133 {
00134     m_buffer[m_len] = 0;
00135 }

sc_dt::scfx_string::~scfx_string (  )  [inline]

scfx_string.h139 行で定義されています。

00140 {
00141     delete [] m_buffer;
00142 }


関数

void sc_dt::scfx_string::resize ( std::size_t  i  )  [inline, private]

scfx_string.h112 行で定義されています。

00113 {
00114     do {
00115         m_alloc *= 2;
00116     } while( i >= m_alloc );
00117 
00118     char* temp = new char[m_alloc];
00119 
00120     for( int j = 0; j < (int) m_len; ++ j ) {
00121         temp[j] = m_buffer[j];
00122     }
00123     temp[m_len] = 0;
00124 
00125     delete [] m_buffer;
00126     m_buffer = temp;
00127 }

int sc_dt::scfx_string::length (  )  const [inline]

scfx_string.h147 行で定義されています。

00148 {
00149     return m_len;
00150 }

void sc_dt::scfx_string::clear (  )  [inline]

scfx_string.h155 行で定義されています。

00156 {
00157     m_len = 0;
00158     m_buffer[m_len] = 0;
00159 }

char & sc_dt::scfx_string::operator[] ( int  i  )  [inline]

scfx_string.h164 行で定義されています。

00165 {
00166     if( i >= (int) m_alloc ) {
00167         resize( i );
00168     }
00169     return m_buffer[i];
00170 }

void sc_dt::scfx_string::append ( int  n  )  [inline]

scfx_string.h175 行で定義されています。

00176 {
00177     m_len += n;
00178     m_buffer[m_len] = 0;
00179 }

void sc_dt::scfx_string::discard ( int  n  )  [inline]

scfx_string.h183 行で定義されています。

00184 {
00185     m_len -= n;
00186     m_buffer[m_len] = 0;
00187 }

void sc_dt::scfx_string::remove ( int  i  )  [inline]

scfx_string.h191 行で定義されています。

00192 {
00193     for( int j = i + 1; j < (int) m_len; ++ j )
00194         m_buffer[j - 1] = m_buffer[j];
00195     -- m_len;
00196     m_buffer[m_len] = 0;
00197 }

void sc_dt::scfx_string::operator+= ( char  c  )  [inline]

scfx_string.h202 行で定義されています。

00203 {
00204     this->operator [] ( m_len ) = c;
00205     m_len ++;
00206     this->operator [] ( m_len ) = 0;
00207 }

void sc_dt::scfx_string::operator+= ( const char *  s  )  [inline]

scfx_string.h211 行で定義されています。

00212 {
00213     while( *s )
00214         (*this) += *s ++;
00215 }

sc_dt::scfx_string::operator const char * (  )  [inline]

scfx_string.h219 行で定義されています。

00220 {
00221     m_buffer[m_len] = 0;
00222     return m_buffer;
00223 }


変数

std::size_t sc_dt::scfx_string::m_len [private]

scfx_string.h102 行で定義されています。

std::size_t sc_dt::scfx_string::m_alloc [private]

scfx_string.h103 行で定義されています。

scfx_string.h104 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:49 2008に生成されました。  doxygen 1.5.6