gwnavruntime/basesystem/gamewarekey.h Source File

gamewarekey.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 // primary contact: GUAL - secondary contact: NOBODY
8 #ifndef Navigation_GamewareKey_H
9 #define Navigation_GamewareKey_H
10 
11 
14 
15 
16 namespace Kaim
17 {
18 
19 class File;
20 class FileOpenerBase;
21 class GamewareKey;
22 
23 class GamewareKeyConfig
24 {
25 public:
26  GamewareKeyConfig()
27  : m_gamewareKey(KY_NULL)
28  , m_gamewareKeyFileName(KY_NULL)
29  , m_fileOpener(KY_NULL)
30  {}
31 
32  //void InitWithGamewareKey(const char* gamewareKey)
33  //{
34  // m_gamewareKey = gamewareKey;
35  // m_gamewareKeyFileName = KY_NULL;
36  // m_fileOpener = KY_NULL;
37  //}
38 
39  //void InitWithGamewareKeyFileName(const char* gamewareKeyFileName, FileOpenerBase* fileOpener = KY_NULL)
40  //{
41  // m_gamewareKey = gamewareKey;
42  // m_gamewareKeyFileName = KY_NULL;
43  // m_fileOpener = fileOpener;
44  //}
45 
46 public:
47  const char* m_gamewareKey;
48  const char* m_gamewareKeyFileName;
49  FileOpenerBase* m_fileOpener;
50 };
51 
52 
53 class GamewareKey
54 {
55 public:
56  static GamewareKey& GetInstance()
57  {
58  static GamewareKey s_instance;
59  return s_instance;
60  }
61 
62  KyResult Init(const GamewareKeyConfig& config);
63 
64  const char* GetKey() { return m_key; }
65 
66 private:
67  GamewareKey() { m_key[0] = '\0'; }
68  KyResult SetKeyFromFile(const char* fileName, FileOpenerBase* fileOpener);
69  KyResult SetKeyFromFile(File* file);
70  void SetKey(const char* key);
71 
72 private:
73  char m_key[128];
74 };
75 
76 }
77 
78 #endif
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20