ebcdicconverter.inl

来自「为字符转换分类在ASCII和EBCDIC (IBM计算机主机)字符之间table」· INL 代码 · 共 64 行

INL
64
字号
//=============================================================================
//  BBDSoft General component library
//  Copyright (C) 2001, UAB "BBD SOFT" ( http://www.bbdsoft.com/ )
//
// This material is provided "as is", with absolutely no warranty expressed
// or implied. Any use is at your own risk.
//
// Permission to use or copy this software for any purpose is hereby granted 
// without fee, provided the above notices are retained on all copies.
// Permission to modify the code and to distribute modified code is granted,
// provided the above notices are retained, and a notice that the code was
// modified is included with the above copyright notice.
//
//  The author of this program may be contacted at developers@bbdsoft.com
//=============================================================================

#ifndef _EBCDICCONVERTER_INL
#define _EBCDICCONVERTER_INL

//-----------------------------------------------------------------------------
inline
char EBCDICConverter::toEBCDIC ( const char inChar )
{
return theASCIItoEBCDICTable[inChar];
} // end EBCDICConverter::toEBCDIC (..)


//-----------------------------------------------------------------------------
inline
char EBCDICConverter::toASCII ( const char inChar )
{
return theEBCDICtoASCIITable[inChar];
} // end EBCDICConverter::toASCII (..)


//-----------------------------------------------------------------------------
inline
short EBCDICConverter::swapShort(const short inWord)
{
char * aWord = (char*)&inWord;
short newWord;
char * aNewWord = (char*)&newWord;
aNewWord[0]=aWord[1];
aNewWord[1]=aWord[0];
return newWord;
} // end EBCDICConverter::swapShort (..)


//-----------------------------------------------------------------------------
inline
long EBCDICConverter::swapLong(const long inDWord)
{
char * aWord = (char*)&inDWord;
long newDWord;
char * aNewWord = (char*)&newDWord;
aNewWord[0]=aWord[3];
aNewWord[1]=aWord[2];
aNewWord[2]=aWord[1];
aNewWord[3]=aWord[0];
return newDWord;
} // end EBCDICConverter::swapLong (..)

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?