gwnavgeneration/common/generatorfile.h Source File

generatorfile.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 // primary contact: GUAL - secondary contact: NOBODY
9 #ifndef GwNavGen_GeneratorFile_H
10 #define GwNavGen_GeneratorFile_H
11 
12 
17 
18 
19 namespace Kaim
20 {
21 
22 class GeneratorSystem;
23 class File;
24 
25 
26 class GeneratorFile
27 {
28  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
29  KY_CLASS_WITHOUT_COPY(GeneratorFile)
30 public:
31  enum MakeDir { DO_MAKE_DIR = 0, DO_NOT_MAKE_DIR = 1, MakeDir_FORCE32 = 0xFFFFFFFF };
32 
33  GeneratorFile();
34  GeneratorFile(GeneratorSystem* sys, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
35  ~GeneratorFile();
36 
37  void Init(GeneratorSystem* sys, const char* fileName, const FileOpenerMode openMode, MakeDir makeDir = DO_MAKE_DIR);
38 
39  enum DoErrorMessage { DO_ERROR_MESSAGE, DO_NOT_ERROR_MESSAGE };
40  File* GetFile(DoErrorMessage = DO_ERROR_MESSAGE);
41 
42  void Close();
43 
44 private:
45  GeneratorSystem* m_sys;
46  String m_fileName;
47  FileOpenerMode m_openMode;
48  MakeDir m_makeDir;
49  Ptr<File> m_file;
50 };
51 
52 
53 }
54 
55 
56 #endif
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
FileOpenerMode
Enumerates the possible modes for opening a file with a class that derives from FileOpenerBase.
Definition: fileopener.h:28
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137