mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
The KeyValues class belongs here. Also reimplemented most loading methods for KeyValues, and adjusted the VPK building code to account for it. Pointers to the engine's implementation of KeyValues have been moved to a separate header ('keyvalues_iface.h'), as this allows external tools code to utilize the standalone KeyValues class implementation. Playlist utilities are completely separated from the KeyValues header; these have nothing to do with KeyValues other than manipulating a global KeyValues object for the playlists, and thus have been named as such and moved to rtech/playlists.
35 lines
591 B
C++
35 lines
591 B
C++
#ifndef KVERRORCONTEXT_H
|
|
#define KVERRORCONTEXT_H
|
|
#include "kverrorstack.h"
|
|
|
|
// a simple helper that creates stack entries as it goes in & out of scope
|
|
class CKeyErrorContext
|
|
{
|
|
public:
|
|
~CKeyErrorContext()
|
|
{
|
|
g_KeyValuesErrorStack.Pop();
|
|
}
|
|
explicit CKeyErrorContext(int symName)
|
|
{
|
|
Init(symName);
|
|
}
|
|
void Reset(int symName)
|
|
{
|
|
g_KeyValuesErrorStack.Reset(m_stackLevel, symName);
|
|
}
|
|
int GetStackLevel() const
|
|
{
|
|
return m_stackLevel;
|
|
}
|
|
private:
|
|
void Init(int symName)
|
|
{
|
|
m_stackLevel = g_KeyValuesErrorStack.Push(symName);
|
|
}
|
|
|
|
int m_stackLevel;
|
|
};
|
|
|
|
#endif // KVERRORCONTEXT_H
|