ProgParams.cpp 1014 B

123456789101112131415161718192021222324252627282930313233
  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <Common.h>
  5. #include "ProgParams.h"
  6. //---------------------------------------------------------------------------
  7. #pragma package(smart_init)
  8. //---------------------------------------------------------------------------
  9. TProgramParams * TProgramParams::SInstance = NULL;
  10. //---------------------------------------------------------------------------
  11. TProgramParams * __fastcall TProgramParams::Instance()
  12. {
  13. assert(SInstance != NULL);
  14. return SInstance;
  15. }
  16. //---------------------------------------------------------------------------
  17. TProgramParams::TProgramParams()
  18. {
  19. assert(SInstance == NULL);
  20. SInstance = this;
  21. for (int i = 1; i <= ::ParamCount(); i++)
  22. {
  23. Add(ParamStr(i));
  24. }
  25. }
  26. //---------------------------------------------------------------------------
  27. TProgramParams::~TProgramParams()
  28. {
  29. assert(SInstance == this);
  30. SInstance = NULL;
  31. }