diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vkeyedit/vkeyeditDoc.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/vkeyedit/vkeyeditDoc.cpp')
| -rw-r--r-- | utils/vkeyedit/vkeyeditDoc.cpp | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/utils/vkeyedit/vkeyeditDoc.cpp b/utils/vkeyedit/vkeyeditDoc.cpp new file mode 100644 index 0000000..876077d --- /dev/null +++ b/utils/vkeyedit/vkeyeditDoc.cpp @@ -0,0 +1,110 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// vkeyeditDoc.cpp : implementation of the CVkeyeditDoc class +// + +#include "stdafx.h" +#include "vkeyedit.h" + +#include "vkeyeditDoc.h" + + +///////////////////////////////////////////////////////////////////////////// +// CVkeyeditDoc + +IMPLEMENT_DYNCREATE(CVkeyeditDoc, CDocument) + +BEGIN_MESSAGE_MAP(CVkeyeditDoc, CDocument) + //{{AFX_MSG_MAP(CVkeyeditDoc) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CVkeyeditDoc construction/destruction + +CVkeyeditDoc::CVkeyeditDoc() +{ + // TODO: add one-time construction code here + m_pKeyValues = NULL; +} + +CVkeyeditDoc::~CVkeyeditDoc() +{ + m_pKeyValues->deleteThis(); +} + +BOOL CVkeyeditDoc::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + + // TODO: add reinitialization code here + // (SDI documents will reuse this document) + + return TRUE; +} + + + +///////////////////////////////////////////////////////////////////////////// +// CVkeyeditDoc serialization + +void CVkeyeditDoc::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: add storing code here + } + else + { + // TODO: add loading code here + } +} + +///////////////////////////////////////////////////////////////////////////// +// CVkeyeditDoc diagnostics + +#ifdef _DEBUG +void CVkeyeditDoc::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CVkeyeditDoc::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CVkeyeditDoc commands + +BOOL CVkeyeditDoc::OnOpenDocument(LPCTSTR lpszPathName) +{ + if (!CDocument::OnOpenDocument(lpszPathName)) + return FALSE; + + if ( m_pKeyValues != NULL ) + { + m_pKeyValues->deleteThis(); + } + + const char *filename = lpszPathName; + + m_pKeyValues = new KeyValues( filename ); + + m_pKeyValues->LoadFromFile( g_pFileSystem, filename ); + + UpdateAllViews( NULL, 1, (CObject*)m_pKeyValues ); + + // TODO: Add your specialized creation code here + + return TRUE; +} |