gwnavgeneration/common/generatorfile.h Source File

generatorfile.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
13 
14 namespace Kaim
15 {
16 
17 class GeneratorSystem;
18 class GeneratorFileSystem;
19 class File;
20 
21 
22 class GeneratorFile
23 {
24  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
25  KY_CLASS_WITHOUT_COPY(GeneratorFile)
26 public:
27  enum MakeDir { DO_MAKE_DIR = 0, DO_NOT_MAKE_DIR = 1, MakeDir_FORCE32 = 0xFFFFFFFF };
28 
29  GeneratorFile();
30  GeneratorFile(GeneratorSystem* sys, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
31  GeneratorFile(const GeneratorFileSystem* fileSys, FileOpenerBase* fileOpener, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
32  GeneratorFile(const GeneratorFileSystem* fileSys, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
33  ~GeneratorFile();
34 
35  void Init(const GeneratorFileSystem* fileSys, FileOpenerBase* fileOpener, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
36 
37  enum DoErrorMessage { DO_ERROR_MESSAGE, DO_NOT_ERROR_MESSAGE };
38  File* GetFile(DoErrorMessage = DO_ERROR_MESSAGE);
39 
40  void Close();
41 
42 private:
43  const GeneratorFileSystem* m_fileSys;
44  FileOpenerBase* m_fileOpener;
45  String m_fileName;
46  FileOpenerMode m_openMode;
47  MakeDir m_makeDir;
48  Ptr<File> m_file;
49 };
50 
51 
52 }
53 
54 
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
FileOpenerMode
Enumerates the possible modes for opening a file with a class that derives from FileOpenerBase.
Definition: fileopener.h:23
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17