Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.6 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef STYLESYMBOL_H
  6. #define STYLESYMBOL_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #define MAX_PANORAMA_STYLE_SYMBOLS 128
  11. #include "tier0/validator.h"
  12. #include "utlsymbol.h"
  13. #include "utlvector.h"
  14. #ifdef SOURCE_PANORAMA_FIXME
  15. #include "UtlSortVector.h"
  16. #else
  17. #include "utlsortvector.h"
  18. #endif
  19. #include "utlstring.h"
  20. namespace panorama
  21. {
  22. class CStyleProperty;
  23. class CStyleSymbol
  24. {
  25. public:
  26. // constructor, destructor
  27. CStyleSymbol() : m_Id( 0xFF ) {}
  28. CStyleSymbol( uint8 id ) : m_Id( id ) {}
  29. CStyleSymbol( char const* pStr );
  30. CStyleSymbol( char const* pStr, bool bCreateNew );
  31. CStyleSymbol( CStyleSymbol const& sym ) : m_Id(sym.m_Id) {}
  32. // operator=
  33. CStyleSymbol& operator=( CStyleSymbol const& src ) { m_Id = src.m_Id; return *this; }
  34. // operator==
  35. bool operator==( CStyleSymbol const& src ) const { return m_Id == src.m_Id; }
  36. bool operator==( char const* pStr ) const;
  37. // operator !=
  38. bool operator!=( CStyleSymbol const& src ) const { return m_Id != src.m_Id; }
  39. // operator <
  40. bool operator < (const CStyleSymbol &rhs ) const { return m_Id < rhs.m_Id; }
  41. uint8 GetID() const { return m_Id; }
  42. // Is valid?
  43. bool IsValid() const { return m_Id != 0xFF; }
  44. // Gets the string associated with the symbol
  45. char const* String() const;
  46. operator const char *() const { return String(); }
  47. protected:
  48. uint8 m_Id;
  49. };
  50. uint32 HashItem( const CStyleSymbol &item );
  51. } // namespace panorama
  52. #endif // STYLESYMBOL_H