gwnavruntime/blob/blobfile.h Source File

blobfile.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 
8 
9 // primary contact: GUAL - secondary contact: NOBODY
10 #ifndef Navigation_BlobFile_H
11 #define Navigation_BlobFile_H
12 
13 
18 
19 namespace Kaim
20 {
21 
22 class File;
23 class FileOpenerBase;
24 
25 
27 class BlobFile
28 {
29 public:
30  static KyResult Save(File* file, const BaseBlobHandler& blobHandler, Endianness::Type endianness = Endianness::BigEndian);
31 
32  static KyResult Save(const char* fileName, FileOpenerBase* fileOpener, const BaseBlobHandler& blobHandler, Endianness::Type endianness = Endianness::BigEndian);
33 
34  static void* LoadVoid(const char* fileName, FileOpenerBase* fileOpener, BaseBlobHandler& blobHandler);
35 
36  static void* LoadVoid(File* file, BaseBlobHandler& blobHandler);
37 
38  template<class T>
39  static T* Load(const char* fileName, FileOpenerBase* fileOpener, BlobHandler<T>& blobHandler)
40  {
41  return (T*)LoadVoid(fileName, fileOpener, blobHandler);
42  }
43 
44  template<class T>
45  static T* Load(File* file, BlobHandler<T>& blobHandler)
46  {
47  return (T*)LoadVoid(file, blobHandler);
48  }
49 
50 private:
51  static KyResult WriteBuffers(File* file, void* fileHeaderMemory, void* blobMemory, KyUInt32 blobSize);
52  static void CloseFile(File* fileToClose);
53 };
54 
55 } // namespace Kaim
56 
57 
58 #endif
Base interface for a class that opens a file on disk.
Definition: fileopener.h:35
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
The BlobFile class reads/writes the data maintained in a blob from/to a file.
Definition: blobfile.h:27
The BlobHandler class is a top-level mechanism for serializing blobs between objects in memory and fi...
Definition: blobhandler.h:45
Big-endian format (used, for example, for PlayStation 3, Xbox 360).
Definition: endianness.h:31
Definition: gamekitcrowddispersion.h:20
Type
Enumerates possible endianness types.
Definition: endianness.h:28
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36