37template<
typename TYP = TCHAR>
74 operator const TYP*(void)
const
85 if ( m_workSize < m_pos )
89 return m_workSize - m_pos;
98 ASSERT( m_pWork != NULL );
99 ASSERT( m_pos + 1 <= m_workSize );
111 ASSERT( m_pWork != NULL );
112 ASSERT( m_pos + width <= m_workSize );
113 FormatInt(&m_pWork[m_pos], value, width);
125 ASSERT( m_pWork != NULL );
126 m_pos +=
FormatInt(&m_pWork[m_pos], value);
137 ASSERT( m_pWork != NULL );
138 ASSERT( m_pos + width <= m_workSize );
139 FormatHex(&m_pWork[m_pos], value, width);
149 ASSERT( m_pWork != NULL );
150 ASSERT( m_pos + 1 <= m_workSize );
159 template<
typename XX>
162 const TYP* lpsz = literal;
163 size_t len =
sizeof(literal) /
sizeof(TYP);
174 ASSERT( m_pWork != NULL );
176 ASSERT( m_pos + len <= m_workSize );
177 memcpy(&m_pWork[m_pos], lpsz, len *
sizeof(TYP));
192 void Add(
const TYP* lpsz,
size_t len)
194 ASSERT( m_pWork != NULL );
195 ASSERT( m_pos + len <= m_workSize );
196 memcpy(&m_pWork[m_pos], lpsz, len *
sizeof(TYP));
220 unsigned int v = (value < 0) ? -value : value;
225 _P[i] =
static_cast<TYP
>(
'0' + (v % 10));
232 if ( value < 0 && j > 0 )
269 unsigned int v = (value < 0) ? -value : value;
278 buf[j++] =
static_cast<TYP
>(
'0' + (v % 10));
305 unsigned int v = (value < 0) ? -value : value;
308 _P[i] =
static_cast<TYP
>(
'0' + (v % 10));
335 _P[i] =
static_cast<TYP
>(
'0' + (v % 10));
378 buf[j++] =
static_cast<TYP
>(
'0' + (value % 10));
407 _P[i] =
static_cast<TYP
>(
'0' + (value % 10));
426 static void FormatHex(TYP* _P, DWORD value,
size_t width)
439 friend class CTinyStringFormaterTest;
#define loop_dn(VAR, CNT)
loop構文.
#define loop(VAR, CNT)
loop構文.
size_t GetLen(LPCSTR lpsz)
[計算] 文字列長計算(ASCII/SJIS用)
char IntToHexChar(int c)
[変換] 数値HEX文字変換