#ifndef ENCODE_DECODE_TRI
#define ENCODE_DECODE_TRI
#include "Shared/CommonTri.h"
#include <stddef.h>

int decodeInt(int * pNum, const char * pData, int nLen, int nOffset);
int decodeString(char ** ppszStr, const char * pData, int nLen, int nOffset);
int decodeUString(wchar_t ** pwszStr, const char * pData, int nLen, int nOffset);
int decodeQualifiedName(QualifiedName * pName, const char * pData, int nLen, int nOffset);
int decodeBinaryString(BinaryString * pBin, const char * pData, int nLen, int nOffset, int bDecodeBits);
int decodeTimerDuration(TriTimerDuration * pDbl, const char * pData, int nLen, int nOffset);
int decodeCompId(TriComponentId * pComp, const char * pData, int nLen, int nOffset);
int decodePortId(TriPortId * pPort, const char * pData, int nLen, int nOffset);
int decodePortList(TriPortIdList * pList, const char * pData, int nLen, int nOffset);
int decodeAddrList(TriAddressList * pList, const char * pData, int nLen, int nOffset);
int decodeParameter(TriParameter * pParam, char **pParamName, const char * pData, int nLen, int nOffset);
int decodeParamList(TriParameterList * pList, char ***pNameList, const char * pData, int nLen, int nOffset);
int calcStrLen(const char * pszStr);
int calcUStrLen(const wchar_t * wszStr);
int calcBinLen(const BinaryString * pData, int bCountBits);
int calcQualifiedName(const QualifiedName * pName);
int calcCompLen(const TriComponentId * pCompId);
int calcTimerDuration(const TriTimerDuration * pDbl);
int calcPortLen(const TriPortId * pPortId);
int calcParamLen(const TriParameter * pParam, const char * pName);
int calcParamListLen(const TriParameterList * pParamList, const char *** pNameList);
int encodeString(const char * pszStr, char * pData, int nOffset);
int encodeBinData(const BinaryString *pBin, char * pData, int nOffset, int bEncodeBits);
int encodeTimerDuration(const TriTimerDuration *pDbl, char * pData, int nOffset);
int encodeQualifiedName(const QualifiedName * pName, char * pData, int nOffset);
int encodeCompId(const TriComponentId * pCompId, char * pData, int nOffset);
int encodePortId(const TriPortId * pPortId, char * pData, int nOffset);
int encodeUString(const wchar_t * wszStr, char * pData, int nOffset);
int encodeParam(const TriParameter * pParam, const char * pName, char * pData, int nOffset);
int encodeParamList(const TriParameterList * pParamList, const char *** pNameList, char * pData, int nOffset);

#endif
