Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--------------------------------------------------------------------------------------
- // Name: MediaLocator::MediaLocator()
- // Desc: Constructs a MediaLocator object for use with the specified xzp archive.
- //--------------------------------------------------------------------------------------
- MediaLocator::MediaLocator( LPCWSTR szPackage )
- {
- wcscpy_s( m_szPackage, szPackage );
- m_szMediaPath[ 0 ] = L'\0';
- }
- //--------------------------------------------------------------------------------------
- // Name: MediaLocator::SetPackage()
- // Desc: Replace the current working xzp archive with a new one.
- //--------------------------------------------------------------------------------------
- VOID MediaLocator::SetPackage( LPCWSTR szPackage )
- {
- wcscpy_s( m_szPackage, szPackage );
- m_szMediaPath[ 0 ] = L'\0';
- }
- //--------------------------------------------------------------------------------------
- // Name: MediaLocator::GetMediaPath()
- // Desc: Retrieves the path to the media folder that sits inside the xzp archive.
- //--------------------------------------------------------------------------------------
- LPCWSTR MediaLocator::GetMediaPath() const
- {
- if( m_szMediaPath[ 0 ] == L'\0' && m_szPackage[ 0 ] != L'\0' )
- {
- LocateMediaFolder( m_szMediaPath, ARRAYSIZE( m_szMediaPath ), m_szPackage );
- }
- return m_szMediaPath;
- }
- //--------------------------------------------------------------------------------------
- // Name: MediaLocator::ComposeResourceLocator()
- // Desc: If succesful, returns TRUE and szLocator contains the resource locator for the
- // file identified by szPath and szFile that sits inside the media folder of the
- // xzp archive. It returns FALSE upon failure.
- //--------------------------------------------------------------------------------------
- BOOL MediaLocator::ComposeResourceLocator( LPWSTR szLocator, DWORD dwLocatorSize,
- LPCWSTR szPath, LPCWSTR szFile ) const
- {
- if( m_szPackage[ 0 ] == L'\0' )
- return FALSE;
- return ATG::ComposeResourceLocator( szLocator, dwLocatorSize, m_szPackage, GetMediaPath(), szPath, szFile );
- }
- } // namespace ATG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement