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.

74 lines
2.7 KiB

  1. //====== Copyright � 1996-2005, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef IBASEPROJECTGENERATOR_H
  7. #define IBASEPROJECTGENERATOR_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //
  12. // Usage:
  13. //
  14. // StartProject
  15. // StartConfigurationBlock
  16. // StartPropertySection
  17. // HandleProperty...
  18. // EndPropertySection
  19. // EndConfigurationBlock
  20. //
  21. // AddFile...
  22. // [inside each file it can do another configuration block as above]
  23. // [also, files can be put in folders with StartFolder/AddFolder]
  24. // EndProject
  25. //
  26. class IBaseProjectGenerator
  27. {
  28. public:
  29. // What file extension does this use? (vcproj, mak, vpj).
  30. virtual const char* GetProjectFileExtension() = 0;
  31. // Called before doing anything in a project (in g_pVPC->GetOutputFilename()).
  32. virtual void StartProject() = 0;
  33. virtual void EndProject() = 0;
  34. // Access the project name.
  35. virtual CUtlString GetProjectName() = 0;
  36. virtual void SetProjectName( const char *pProjectName ) = 0;
  37. // Get a list of all configurations.
  38. virtual void GetAllConfigurationNames( CUtlVector< CUtlString > &configurationNames ) = 0;
  39. // Configuration data is specified in between these calls and inside BeginPropertySection/EndPropertySection.
  40. // If bFileSpecific is set, then the configuration data only applies to the last file added.
  41. virtual void StartConfigurationBlock( const char *pConfigName, bool bFileSpecific ) = 0;
  42. virtual void EndConfigurationBlock() = 0;
  43. // These functions are called when it enters a section like $Compiler, $Linker, etc.
  44. // In between the BeginPropertySection/EndPropertySection, it'll call HandleProperty for any properties inside that section.
  45. virtual bool StartPropertySection( configKeyword_e keyword, bool *pbShouldSkip = NULL ) = 0;
  46. virtual void HandleProperty( const char *pProperty, const char *pCustomScriptData=NULL ) = 0;
  47. virtual void EndPropertySection( configKeyword_e keyword ) = 0;
  48. // Files go in folders. The generator should maintain a stack of folders as they're added.
  49. virtual void StartFolder( const char *pFolderName ) = 0;
  50. virtual void EndFolder() = 0;
  51. // Add files. Any config blocks/properties between StartFile/EndFile apply to this file only.
  52. // It will only ever have one active file.
  53. virtual bool StartFile( const char *pFilename, bool bWarnIfAlreadyExists ) = 0;
  54. virtual void EndFile() = 0;
  55. // This is actually just per-file configuration data.
  56. virtual void FileExcludedFromBuild( bool bExcluded ) = 0;
  57. virtual void FileIsSchema( bool bIsSchema ) = 0; // Mark the current file as schema.
  58. // Remove the specified file. return true if success
  59. virtual bool RemoveFile( const char *pFilename ) = 0;
  60. };
  61. #endif // IBASEPROJECTGENERATOR_H