101 lines
1.6 KiB
C++
101 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <PublicStruct.h>
|
|
#include <Constant.h>
|
|
|
|
//#if ( defined( UNICODE) && defined( _UNICODE))
|
|
// #define wstring tstring
|
|
//#else
|
|
// #define string tstring
|
|
//#endif
|
|
|
|
class DataInfo
|
|
{
|
|
public:
|
|
|
|
DataInfo()
|
|
: m_Key( 0)
|
|
, m_ParentKey( 0)
|
|
{
|
|
ZeroMemory( m_szName, MAX_WORLD_NAME_SIZE);
|
|
ZeroMemory( m_szVer, MAX_PATCH_VER_SIZE);
|
|
}
|
|
|
|
DataInfo( DWORD key, DWORD pKey, std::string strName, std::string strVer )
|
|
: m_Key( key)
|
|
, m_ParentKey( pKey)
|
|
{
|
|
SetName( strName.c_str());
|
|
SetVersion( strVer.c_str());
|
|
}
|
|
|
|
~DataInfo(void);
|
|
|
|
//.//
|
|
|
|
inline const TCHAR* GetName() const
|
|
{
|
|
return m_szName;
|
|
}
|
|
|
|
VOID SetName( const TCHAR* szName )
|
|
{
|
|
_tcsncpy( m_szName, szName, MAX_WORLD_NAME_SIZE);
|
|
}
|
|
|
|
const TCHAR* GetVersion() const
|
|
{
|
|
return m_szVer;
|
|
}
|
|
|
|
VOID SetVersion( const TCHAR* szVer )
|
|
{
|
|
_tcsncpy( m_szVer, szVer, MAX_PATCH_VER_SIZE);
|
|
}
|
|
|
|
//.//
|
|
|
|
operator SCFOLDER_INFO()
|
|
{
|
|
return SCFOLDER_INFO( m_Key, m_ParentKey, m_szName, m_szVer);
|
|
}
|
|
|
|
DataInfo& operator=( const DataInfo& rhs )
|
|
{
|
|
m_Key = rhs.m_Key;
|
|
m_ParentKey = rhs.m_ParentKey;
|
|
|
|
SetName( rhs.m_szName);
|
|
SetVersion( rhs.m_szVer);
|
|
|
|
return ( *this);
|
|
}
|
|
|
|
DataInfo& operator=( const SCFOLDER_INFO& rhs )
|
|
{
|
|
return this->operator =( DataInfo( rhs.m_Key,
|
|
rhs.m_ParentKey,
|
|
rhs.m_szName,
|
|
rhs.m_szVer));
|
|
}
|
|
|
|
bool operator==( const DataInfo& rhs ) const
|
|
{
|
|
return ( rhs.m_Key == m_Key);
|
|
}
|
|
|
|
bool operator >( const DataInfo& rhs ) const
|
|
{
|
|
return ( m_Key > rhs.m_Key);
|
|
}
|
|
|
|
//.//
|
|
|
|
private:
|
|
|
|
DWORD m_Key;
|
|
DWORD m_ParentKey;
|
|
TCHAR m_szName[MAX_WORLD_NAME_SIZE];
|
|
TCHAR m_szVer[MAX_PATCH_VER_SIZE];
|
|
};
|