VTFLib
A C and C++ API that, with a few simple functions, can open and save .vtf and .vmt files.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VMTFile.h
1 /*
2  * VTFLib
3  * Copyright (C) 2005-2010 Neil Jedrzejewski & Ryan Gregg
4 
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later
9  * version.
10  */
11 
12 #ifndef VTFLIB_VMTFILE_H
13 #define VTFLIB_VMTFILE_H
14 
15 #include "stdafx.h"
16 #include "Readers.h"
17 #include "Writers.h"
18 #include "VMTNodes.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
25 typedef enum tagVMTParseMode
26 {
27  PARSE_MODE_STRICT = 0,
28  PARSE_MODE_LOOSE,
29  PARSE_MODE_COUNT
30 } VMTParseMode;
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 namespace VTFLib
37 {
38  class VTFLIB_API CVMTFile
39  {
40  private:
41  Nodes::CVMTGroupNode *Root;
42 
43  public:
44  CVMTFile();
45  CVMTFile(const CVMTFile &VMTFile);
46  ~CVMTFile();
47 
48  public:
49  vlBool Create(const vlChar *cRoot);
50  vlVoid Destroy();
51 
52  vlBool IsLoaded() const;
53 
54  vlBool Load(const vlChar *cFileName);
55  vlBool Load(const vlVoid *lpData, vlSize uiBufferSize);
56  vlBool Load(vlVoid *pUserData);
57 
58  vlBool Save(const vlChar *cFileName) const;
59  vlBool Save(vlVoid *lpData, vlSize uiBufferSize, vlSize &uiSize) const;
60  vlBool Save(vlVoid *pUserData) const;
61 
62  private:
63  vlBool Load(IO::Readers::IReader *Reader);
64  vlBool Save(IO::Writers::IWriter *Writer) const;
65 
66  //Nodes::CVMTNode *Load(IO::Readers::IReader *Reader, vlBool bInGroup);
67 
68  vlVoid Indent(IO::Writers::IWriter *Writer, vlUInt uiLevel) const;
69  vlVoid Save(IO::Writers::IWriter *Writer, Nodes::CVMTNode *Node, vlUInt uiLevel = 0) const;
70 
71  public:
72  Nodes::CVMTGroupNode *GetRoot() const;
73  };
74 }
75 
76 #endif
char vlChar
Single signed character.
Definition: stdafx.h:51
unsigned int vlUInt
Unsigned integer value.
Definition: stdafx.h:56
Application framework header plus VTFLib custom data types.
void vlVoid
Void value.
Definition: stdafx.h:61
unsigned char vlBool
Boolean value 0/1.
Definition: stdafx.h:50