void AsciiToInt2( LPTSTR pszAscii, LPINT a, LPINT b ) /***********************************************************************/ { LPTSTR psz, pszStr = pszAscii; WORD wChar; // replace commas with NULL terminators while( *pszStr ) { if( IsDBCSLeadByte(( BYTE )*pszStr )) wChar = *(( LPWORD )pszStr ); else wChar = *pszStr; if( wChar == _T(',') ) { psz = pszStr; pszStr = MyCharNext( pszStr ); *psz = _T('\0'); } else pszStr = MyCharNext( pszStr ); } pszStr = pszAscii; *a = Ascii2Int( pszStr ); pszStr += ( lstrlen( pszStr ) + 1 ); *b = Ascii2Int( pszStr ); }
void AsciiRGB( LPTSTR pszAscii, LPRGB pRGB ) /***********************************************************************/ { LPTSTR psz, pszStr = pszAscii; WORD wChar; // replace commas with NULL terminators while( *pszStr ) { if( IsDBCSLeadByte(( BYTE )*pszStr )) wChar = *(( LPWORD )pszStr ); else wChar = *pszStr; if( wChar == _T(',') ) { psz = pszStr; pszStr = MyCharNext( pszStr ); *psz = _T('\0'); } else pszStr = MyCharNext( pszStr ); } pRGB->red = Ascii2Int( pszAscii ); pszAscii += (lstrlen( pszAscii ) + 1 ); pRGB->green = Ascii2Int( pszAscii ); pszAscii += (lstrlen( pszAscii ) + 1 ); pRGB->blue = Ascii2Int( pszAscii ); }
void AsciiToInt4( LPTSTR pszAscii, LPINT a, LPINT b, LPINT c, LPINT d ) /***********************************************************************/ { LPTSTR psz, pszStr = pszAscii; WORD wChar; while( *pszStr ) { if( IsDBCSLeadByte(( BYTE )*pszStr )) wChar = *(( LPWORD )pszStr ); else wChar = *pszStr; if( wChar == _T(',') ) { psz = pszStr; pszStr = MyCharNext( pszStr ); *psz = _T('\0'); } else pszStr = MyCharNext( pszStr ); } psz = pszStr; *a = Ascii2Int( psz ); psz += (lstrlen( psz ) + 1 ); *b = Ascii2Int( psz ); psz += (lstrlen( psz ) + 1 ); *c = Ascii2Int( psz ); psz += (lstrlen( psz ) + 1 ); *d = Ascii2Int( psz ); }
int GetIntParm( LPTSTR pszCommand, int nParam, LPINT pbTranslated ) /***********************************************************************/ { if( !( pszCommand = SkipParm( pszCommand, nParam ))) { if( pbTranslated ) *pbTranslated = FALSE; return( 0 ); } if( pbTranslated ) *pbTranslated = TRUE; return( Ascii2Int( pszCommand )); }
BigInt::BigInt(std::string str) { transform(str.rbegin(),str.rend(),back_inserter(digits),Ascii2Int()); }