diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/public/fgdlib/helperinfo.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/public/fgdlib/helperinfo.h')
| -rw-r--r-- | sp/src/public/fgdlib/helperinfo.h | 256 |
1 files changed, 128 insertions, 128 deletions
diff --git a/sp/src/public/fgdlib/helperinfo.h b/sp/src/public/fgdlib/helperinfo.h index f539a112..affd5666 100644 --- a/sp/src/public/fgdlib/helperinfo.h +++ b/sp/src/public/fgdlib/helperinfo.h @@ -1,128 +1,128 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-//=============================================================================
-
-#ifndef HELPERINFO_H
-#define HELPERINFO_H
-#pragma once
-
-#include <tier0/dbg.h>
-#include <utlvector.h>
-
-
-#define MAX_HELPER_NAME_LEN 256
-
-
-typedef CUtlVector<char *> CParameterList;
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-class CHelperInfo
-{
- public:
-
- inline CHelperInfo(void);
- inline ~CHelperInfo(void);
-
- inline const char *GetName(void) const { return(m_szName); }
- inline void SetName(const char *pszName);
-
- inline bool AddParameter(const char *pszParameter);
-
- inline int GetParameterCount(void) const { return(m_Parameters.Count()); }
- inline const char *GetParameter(int nIndex) const;
-
- protected:
-
- char m_szName[MAX_HELPER_NAME_LEN];
- CParameterList m_Parameters;
-};
-
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-inline CHelperInfo::CHelperInfo(void)
-{
- m_szName[0] = '\0';
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-inline CHelperInfo::~CHelperInfo(void)
-{
- int nCount = m_Parameters.Count();
- for (int i = 0; i < nCount; i++)
- {
- char *pszParam = m_Parameters.Element(i);
- Assert(pszParam != NULL);
- if (pszParam != NULL)
- {
- delete [] pszParam;
- }
- }
-
- m_Parameters.RemoveAll();
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : char *pszParameter -
-// Output : Returns true on success, false on failure.
-//-----------------------------------------------------------------------------
-inline bool CHelperInfo::AddParameter(const char *pszParameter)
-{
- if ((pszParameter != NULL) && (pszParameter[0] != '\0'))
- {
- int nLen = strlen(pszParameter);
-
- if (nLen > 0)
- {
- char *pszNew = new char [nLen + 1];
- if (pszNew != NULL)
- {
- strcpy(pszNew, pszParameter);
- m_Parameters.AddToTail(pszNew);
- return(true);
- }
- }
- }
-
- return(false);
-}
-
-
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-inline const char *CHelperInfo::GetParameter(int nIndex) const
-{
- if (nIndex >= m_Parameters.Count())
- return NULL;
-
- return m_Parameters.Element(nIndex);
-}
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-// Input : char *pszName -
-//-----------------------------------------------------------------------------
-inline void CHelperInfo::SetName(const char *pszName)
-{
- if (pszName != NULL)
- {
- strcpy(m_szName, pszName);
- }
-}
-
-
-typedef CUtlVector<CHelperInfo *> CHelperInfoList;
-
-
-#endif // HELPERINFO_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +//============================================================================= + +#ifndef HELPERINFO_H +#define HELPERINFO_H +#pragma once + +#include <tier0/dbg.h> +#include <utlvector.h> + + +#define MAX_HELPER_NAME_LEN 256 + + +typedef CUtlVector<char *> CParameterList; + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class CHelperInfo +{ + public: + + inline CHelperInfo(void); + inline ~CHelperInfo(void); + + inline const char *GetName(void) const { return(m_szName); } + inline void SetName(const char *pszName); + + inline bool AddParameter(const char *pszParameter); + + inline int GetParameterCount(void) const { return(m_Parameters.Count()); } + inline const char *GetParameter(int nIndex) const; + + protected: + + char m_szName[MAX_HELPER_NAME_LEN]; + CParameterList m_Parameters; +}; + + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +inline CHelperInfo::CHelperInfo(void) +{ + m_szName[0] = '\0'; +} + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +inline CHelperInfo::~CHelperInfo(void) +{ + int nCount = m_Parameters.Count(); + for (int i = 0; i < nCount; i++) + { + char *pszParam = m_Parameters.Element(i); + Assert(pszParam != NULL); + if (pszParam != NULL) + { + delete [] pszParam; + } + } + + m_Parameters.RemoveAll(); +} + + +//----------------------------------------------------------------------------- +// Purpose: +// Input : char *pszParameter - +// Output : Returns true on success, false on failure. +//----------------------------------------------------------------------------- +inline bool CHelperInfo::AddParameter(const char *pszParameter) +{ + if ((pszParameter != NULL) && (pszParameter[0] != '\0')) + { + int nLen = strlen(pszParameter); + + if (nLen > 0) + { + char *pszNew = new char [nLen + 1]; + if (pszNew != NULL) + { + strcpy(pszNew, pszParameter); + m_Parameters.AddToTail(pszNew); + return(true); + } + } + } + + return(false); +} + + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +inline const char *CHelperInfo::GetParameter(int nIndex) const +{ + if (nIndex >= m_Parameters.Count()) + return NULL; + + return m_Parameters.Element(nIndex); +} + + +//----------------------------------------------------------------------------- +// Purpose: +// Input : char *pszName - +//----------------------------------------------------------------------------- +inline void CHelperInfo::SetName(const char *pszName) +{ + if (pszName != NULL) + { + strcpy(m_szName, pszName); + } +} + + +typedef CUtlVector<CHelperInfo *> CHelperInfoList; + + +#endif // HELPERINFO_H |