Counter Strike : Global Offensive Source Code
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.

47 lines
1.4 KiB

  1. /// These functions define the MANAGED interface. This file has /CLR.
  2. ///
  3. /// Defines an interface which may be called from the MANAGED code's
  4. /// main function to start up (connect) and shut down (disconnect)
  5. /// the app system interface.
  6. /// This class is a singleton. It gets manufactured explicitly
  7. /// from the Manufacture() call, which is a factory function that
  8. /// your app must implement in a non-/CLR file it will presumably
  9. /// return your custom type of CCLI_AppSystem_Adapter_Unmanaged).
  10. /// Calling Startup() will connect the app system and
  11. /// Shutdown() will disconnect it.
  12. #include "stdafx.h"
  13. #pragma unmanaged
  14. #include "cli_appsystem_unmanaged_wrapper.h"
  15. #pragma managed
  16. // Allocate the native object on the C++ Heap via a constructor
  17. ManagedAppSystem::AppSystemWrapper::AppSystemWrapper()
  18. {
  19. m_Impl = new AppSystemWrapper_Unmanaged( StrToAnsi(Environment::CommandLine) );
  20. }
  21. ManagedAppSystem::AppSystemWrapper::~AppSystemWrapper()
  22. {
  23. delete m_Impl;
  24. m_Impl = NULL;
  25. }
  26. // Deallocate the native object on the finalizer just in case no destructor is called
  27. ManagedAppSystem::AppSystemWrapper::!AppSystemWrapper()
  28. {
  29. delete m_Impl;
  30. m_Impl = NULL;
  31. }
  32. #pragma unmanaged
  33. #include "cli_appsystem_adapter.h"
  34. #pragma managed
  35. void ManagedAppSystem::AppSystemWrapper::SetFileSystemSearchRoot( String ^path )
  36. {
  37. m_Impl->Get()->AddFileSystemRoot( StrToAnsi(path) );
  38. }