MCPcopy Create free account
hub / github.com/Sinflower/UberWolf / CharCodeStringToString

Function CharCodeStringToString

3rdParty/DXLib/CharCode.cpp:1416–1471  ·  view source on GitHub ↗

1文字4バイトの配列を文字列に変換する( 戻り値:変換後のサイズ、ヌル文字含む( 単位:バイト ) )

Source from the content-addressed store, hash-verified

1414
1415// 1文字4バイトの配列を文字列に変換する( 戻り値:変換後のサイズ、ヌル文字含む( 単位:バイト ) )
1416extern int CharCodeStringToString( const u32 *Src, char *Dest, int DestCharCodeFormat )
1417{
1418 int DestSize ;
1419 u8 *DestStr ;
1420 int WriteSize ;
1421
1422 DestStr = ( u8 * )Dest ;
1423 DestSize = 0 ;
1424 for(;;)
1425 {
1426 if( *Src == 0 )
1427 {
1428 break ;
1429 }
1430
1431 WriteSize = PutCharCode_inline( *Src, DestCharCodeFormat, ( char * )DestStr ) ;
1432 if( DestStr != NULL )
1433 {
1434 DestStr += WriteSize ;
1435 }
1436 DestSize += WriteSize ;
1437 Src ++ ;
1438 }
1439
1440 switch( DestCharCodeFormat )
1441 {
1442 case 1 :
1443 if( DestStr != NULL )
1444 {
1445 ( ( u8 * )DestStr )[ 0 ] = 0 ;
1446 DestStr += 1;
1447 }
1448 DestSize += 1 ;
1449 break ;
1450
1451 case 2 :
1452 if( DestStr != NULL )
1453 {
1454 ( ( u16 * )DestStr )[ 0 ] = 0 ;
1455 DestStr += 2;
1456 }
1457 DestSize += 2 ;
1458 break ;
1459
1460 case 4 :
1461 if( DestStr != NULL )
1462 {
1463 ( ( u32 * )DestStr )[ 0 ] = 0 ;
1464 DestStr += 4 ;
1465 }
1466 DestSize += 4 ;
1467 break ;
1468 }
1469
1470 return DestSize ;
1471}
1472
1473// ConvString の冒頭部分のマクロ

Callers

nothing calls this directly

Calls 1

PutCharCode_inlineFunction · 0.85

Tested by

no test coverage detected