-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathResourceParser.h
38 lines (33 loc) · 1.32 KB
/
ResourceParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//--------------------------------------------------------------------------------------
// ResourceParser.h
//
// Class to handle resource parsing.
//
// This is just a sample class parsing some temporary resource files.
// The resource files can be in any format you choose.
// This class doesn't perform many checks against wrong file formatting.
// It assumes that the resource file will not be tampered with. The goal is to show
// how to use resources for localization.
//
// Advanced Technology Group (ATG)
// Copyright (C) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#pragma once
#include "pch.h"
#include <collection.h>
class ResourceParser
{
public:
ResourceParser(void);
ResourceParser( wchar_t* localeName, wchar_t* appendImageStr );
~ResourceParser(void);
HRESULT ParseFile( const wchar_t* filename );
Platform::String^ GetString( Platform::String^ id );
Platform::String^ GetImage( Platform::String^ id );
private:
void TrimString( std::wstring& wstr );
Platform::String^ m_localeName;
Platform::String^ m_appendImageStr;
Platform::Collections::Map< Platform::String^, Platform::String^ >^ m_stringMap;
Platform::Collections::Map< Platform::String^, Platform::String^ >^ m_imageMap;
};