#ifndef _JDECODE_UNICODEINFO_HPP_
#define _JDECODE_UNICODEINFO_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_PUREVIEWOFFILE_HPP_
#include <common/pview.hpp>
#endif
#ifndef _JDECODE_PUREINFO_HPP_
#include <jdecode/pinfo.hpp>
#endif

class UnicodeInfo : public PureInfo
{
public:
  UnicodeInfo();
	virtual ~UnicodeInfo();
	PureViewOfFile &operator<<(PureViewOfFile &classView);
	BYTE tag(void)const;
	WORD length(void)const;
	const Array<PureWORD> &bytes(void)const;
private:
  BYTE mTag;
	WORD mLength;
	Array<PureWORD> mBytes;  // mBytes.size(mLength);
};

inline
UnicodeInfo::UnicodeInfo()
: mTag(0), mLength(0)
{
}

inline
UnicodeInfo::~UnicodeInfo()
{
}

inline
PureViewOfFile &UnicodeInfo::operator<<(PureViewOfFile &classView)
{
  WORD wordItem;
  classView.read(mTag);
	classView.read(mLength);
	mBytes.size(length());
	for(int itemIndex=0;itemIndex<mBytes.size();itemIndex++)
	{
	  classView.read(wordItem);
		mBytes[itemIndex]=wordItem;
	}
  return classView;
}

inline
BYTE UnicodeInfo::tag(void)const
{
  return mTag;
}

inline
WORD UnicodeInfo::length(void)const
{
  return mLength;
}

inline
const Array<PureWORD> &UnicodeInfo::bytes(void)const
{
  return mBytes;
}
#endif